Thursday, January 15, 2015

BO Size limits - Sparse Columns use in TRIRIGA with Microsoft SQL Server

Microsoft SQL Server has a limitation for row size at about 8060 bytes of data. This applies to data that is stored in the row. Most VARCHAR/NVARCHAR data is kept off row (just a pointer is stored on the row).

Some users have had issues storing data because the row data is too big on specific Business Object tables (T tables like T_TRIREALESTATECONTRACT, T_TRICAPITALPROJECT and T_TRIBUILDING). Users see the dreaded "Cannot Create a row of size NNNN which is greater than the allowable maximum row size of 8060" in the server.log and they cannot save their record.

To remedy the situation, you must analyze the Business Object and delete unused fields. Another alternative you can use is sparse columns.

Sparse column support was introduced in SQL Server 2008. A sparse column is an ordinary column that has been optimized for null value storage. Null value storage is optimized at the expense of value storage; a sparse column with a null value takes up no storage space at all. However, if the column has a value, 2-4 extra bytes over the value size are required to save the field value. There is a trade-off and the ratio of non-null to null values needs to be significant for any benefit. Microsoft suggests not using sparse columns unless the space saved is at least 20-40%. There is also a cost when reading non-null values from sparse columns; table operations including this column may require more processing.
Depending on the data being stored, this could be an option for making the row sizes smaller.
TRIRIGA Application Platform 3.4.1 does not support sparse columns out of the box. To make a sparse column, you would need to work outside of TRIRIGA directly in the database. You also need to avoid publishing the Business Object as this could make the field revert to non-sparse.


For more information, see the Microsoft documentation (http://technet.microsoft.com) and search on sparse columns. Use sparse columns sparingly as they could have a performance impact to your system depending on the data."

No comments:

Post a Comment