Compressed Columns with Large Objects

SAP ASE lets you create databases and compress columns that use the text, image, unitext, in-row, and java large object (LOB) datatypes.

LOB columns can contain up to 2,147,483,647 (or 231 -1) bytes of character or binary data. LOB values are stored on a text page chain. Only text pages are compressed.

In-row LOB compression is used if: The table is implicitly or explicitly row- or page-compressed, and, Any of the in-row large object columns in the table are implicitly or explicitly LOB compressed.
SAP ASE uses the FastLZ (with LZO) and ZLib (with LZW.26) algorithm to compress LOB data. Both are dictionary-based compression techniques; that is, they replace repeated words on the data page with a status bit that points to the actual word in an index. The differences are:

SAP ASE automatically determines the algorithm to use when you select the compression level. Levels 1 – 9 use the ZLib technique, and levels 100 and 101 use the FastLZ technique.

Generally, the higher the compression level, the more the LOB is compressed. However, the amount of compression depends on the content of the LOB. The higher the compression level, the more CPU-intensive the process, so a compression_level of 9 provides the best compression ratio, but also the heaviest CPU usage.

You can combine table-level and column-level compression.

Combining Table- and Column-Level Compression

Compression Level

No Column Compression

Column is not compressed

Column uses compression_level Scale

No table-level compression

Uncompressed

Uncompressed

Column-level compression

lob_compression = 0

Uncompressed

Uncompressed

Column-level compression

lob_compression is the same as the table-level compression

Column level compression

Uncompressed

Column-level compression

The page layout is altered when LOB columns are compressed.