How is your experience with the OutSystems Community?
22
Views
4
Comments
Increasing the length of a text column

I have an entity with a text column that is 50 characters long, and I need to increase its length to 100 characters.

My application runs across multiple environments for several customers, using both SQL Server and Oracle databases. In some customer environments, this entity may contain many millions of records.

There is an index on this column.

What I need to know is whether there is any risk that the deployment could fail due to a timeout when altering the column length.

2023-12-26 10-35-28
OutSystems Neo
Staff
AI Generated

Yes, there can be a timeout risk, but it depends on:

  • Platform Server version
  • Database type (SQL Server / Oracle)
  • Exact operation being generated by OutSystems for that change

How OutSystems handles these changes

OutSystems will generate an ALTER TABLE to change the column length. If that change forces data movement or index rebuilds on a table with millions of rows, the operation can run for a long time and potentially hit a timeout.

You already have two important risk factors:

  • Table with millions of records
  • Column is indexed

On very large tables, changing the length of an indexed text column may cause:

  • Table / index locks for a long time
  • Index rebuilds
  • Long-running DDL/DML that may hit DB or platform timeouts

The article you shared about timeouts when adding attributes describes exactly this kind of situation: operations that need to touch all rows in huge tables may time out during the “Update Database” phase of deployment in older Platform Server versions Application deployment takes too long after adding a new Entity Attribute.

There’s also a forum example where an ALTER TABLE failed because a previous operation left the table locked, and the second ALTER TABLE timed out during publish ALTER TABLE issue while publishing OSP.

So from an OutSystems perspective:

  • Yes, timeouts are possible when changing the data model on large tables.
  • They’re more likely on environments with older Platform Server versions and in databases under high load or with aggressive timeout settings.

SQL Server vs Oracle

  • SQL Server / Oracle both can take a long time for such an ALTER TABLE, depending on:
    • How the RDBMS implements length change for VARCHAR / NVARCHAR
    • Whether index rebuild is needed
  • On Oracle, be extra careful with datatype changes around the 2000-char boundary; that’s where a breaking change is documented (changing the underlying type, e.g. VARCHAR2 → CLOB) can fail, though your case (50 → 100) stays well below that threshold Side Effects and Breaking Changes in OutSystems 11 - Database - Oracle.

Your specific change (50 → 100 chars) is relatively small, but with millions of rows and an index, it can still be heavy.

Practical risk assessment

Higher risk of timeout if:

Lower risk if:

Mitigation strategies

To reduce the chance of deployment failure due to timeout:

  1. Check Platform Server version on each customer environment

  2. Increase timeout settings (self-managed)

  3. Plan the change during low-usage / maintenance windows

    • So the ALTER TABLE and index work can complete with fewer locks/contention.
  4. Validate in a representative staging environment

    • With similar data volume for at least one large customer.
    • Time the deployment and check DB logs for lock/timeout patterns.

Summary

  • Yes, there is a realistic risk that the deployment could fail due to timeout when altering the length of an indexed text column on a table with many millions of rows, especially on older Platform Server versions or tightly configured DB timeouts.
  • The change (50 → 100 chars) is technically safe in terms of data type, but can be operationally heavy.
  • To minimize risk, upgrade to 11.11.1+, consider increasing DB query timeouts (where possible), and deploy during a maintenance window after testing in a staging environment that mimics large customer data volumes.
This answer was AI-generated. Please read it carefully and use the forums for clarifications
2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

I cannot say for Oracle, but in SQL Server, I haven't seen timeouts when resizing an attribute, even with millions of records.

2024-01-20 14-53-12
Ahmed Essawy

Adding the “why” behind Kilian’s experience:

SQL Server: NVARCHAR(50) to NVARCHAR(100) is a metadata-only change. Existing rows aren’t rewritten, so it finishes almost instantly regardless of row count. It’s also allowed on an indexed column when the type stays the same, the size grows, and the index isn’t the primary key (see ALTER TABLE … ALTER COLUMN in the SQL Server docs). The index isn’t rebuilt.

Oracle: increasing a VARCHAR2 length is also a data-dictionary change. Existing rows and the index aren’t touched.

The real risk is the lock, not the duration. The ALTER needs a schema-modification lock, so it waits behind any open transaction or long query on that table, and new queries queue behind it. That is what makes a deploy look stuck or time out on a busy table. So:

  • Deploy outside peak hours, when no long timers or batch jobs are hitting that entity.
  • If you want certainty, time the ALTER on a production-size copy for each engine.
  • During deployment, watch blocking with sys.dm_exec_requests (blocking_session_id) on SQL Server, or v$session on Oracle.

Shrinking the column (100 → 50) would be a different story, because existing data would have to be checked.

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

In my experience shrinking is often not possible from OutSystems, even if there are no strings that exceed the limit.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.