What is Block Level Compression (BLC), and how does it work?

Teradata 13.10 introduced Block Level Compression (BLC), a feature that compresses entire data blocks instead of applying compression methods on a column level, such as MVC and ALC.

Compression is applied solely to data blocks containing rows, while the table headers, master index, cylinder index, and write-ahead log (WAL) remain uncompressed. Although primarily intended for permanent tables, block-level compression may also be activated for spool space, temporary space, permanent journal, and workspace utilized for sorting operations.

Applying block-level compression to a table compresses and stores all data blocks on the hard disk or other mass storage devices, reducing disk space.

Tables with column-level compression offer a significant advantage by reducing disk IOs. Teradata preserves compression in spool tables throughout the query processing. However, it is important to note that this advantage does not apply to block-level compression. It is essential to clarify this distinction.

Block Level Compression is not a performance optimization feature.

Each time a data block is accessed, the full block must be transferred from the disk to the FSG cache and decompressed. This process is expensive, and uncompressed blocks, even when cached, cannot be recycled by other sessions or the same session.

If a data block is required for a second session, it must be decompressed, regardless of whether it is already in the FSG cache. Likewise, when changing a row, the data block must first be moved to the FSG cache and uncompressed. Teradata carries out the modification, followed by compression and returning the data block to the disk.

BLC applied to Fallback protected tables compresses the primary table and the data blocks associated with the fallback protection sub-table. It is not possible to selectively compress only the primary table or fallback sub-table.

Block Level Compression effectively reduces disk space usage for infrequently accessed tables while minimizing CPU usage for tables with frequent modifications. However, there is an initial one-time cost for compressing all data blocks.

The efficiency of Block Level Compression

The table’s data blocks have varying compression rates determined by the demographics of each block’s rows. Teradata leverages the Lempel-Ziv compression algorithm.

Teradata does not compress data blocks that are too small.

When utilizing column-level compression such as MVC or ALC in conjunction with BLC, the advantage gained from BLC is reduced compared to using only BLC. Nevertheless, BLC will continue to contribute to the reduction of disk space utilized by the table.

Subtables for secondary indexes (NUSI and USI) will not undergo block-level compression. It is important to keep this in mind for tables that contain multiple secondary indexes, as the reduction in space may surpass initial expectations. However, any existing join indexes will be compressed by Teradata.

Conditional Block Level Compression

As previously mentioned, BLC should be applied with caution, particularly on CPU-reliant systems as compression and decompression tasks require significant CPU usage.

Teradata 14.00 introduced temperature-based Block Level Compression (BLC) to enhance its usability. This feature can be applied to tables either collectively or separately.

The Teradata Virtual Storage (TVS) System classifies data based on temperature, specifically cold, warm, and hot. This categorization is determined by the frequency of data access. TVS creates a map of cylinders, rather than blocks, to establish the temperature classification. Cold data is rarely accessed, while hot data is the most frequently accessed.

The DBS control setting TempBLCTresh determines which data requires compression, and can be configured as COLD, WARM, or HOT. Each setting corresponds to a specific temperature range.

TempBLCTresh = {COLD|WARM|HOT},0..100

Parameter 1 (COLD|WARM|HOT):
COLD: compress only cold data. TVS sorts all permanent disk space cylinders by temperature and considers the 20% least accessed cylinders cold.
WARM: compress cold and warm blocks
HOT: compress all data blocks (but in this case, you should not use temperature-based BLC)

Parameter 2 (0..100):

This value defines the distinction between compressed and uncompressed data. If set to 30, Teradata will compress only the least accessed 30% of the data. All cold data (20%) and 10% of the warm data will be compressed by Teradata.

When to use Teradata Block Level Compression (BLC)

Undoubtedly, BLC yields the greatest compression of disk space; however, it incurs the highest costs in terms of CPU resource utilization. Your responsibility is to attain optimal equilibrium between disk space and resource usage.

BLC is unsuitable for CPU-bound systems. Instead, prioritize achieving higher compression rates with Multivalue Compression (MVC) and Algorithmic Compression (ALC).

BLC is a favorable choice for systems containing infrequently accessed, extensive tables. Additionally, BLC can operate on systems with a CPU utilization below 60-70%.

  • Hi Roland, Can we please get SQL to identify list of tables which are not enabled BLC

  • Avatar
    Manoj Venkatesan says:

    Well put and straight forward content.

  • {"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

    You might also like

    >