IBM Support

Improving storage usage and performance for Db2 column-organized tables via defragmentation

How To


Summary

In Db2, the column values in a column-organized table are stored in an encoded or compressed format where they are tightly packed together in data pages. Updates to values in a column-organized table are not done in-place like in row-organized tables. Instead, update operations are decomposed into separate delete and insert operations internally. Furthermore, the storage used by the deleted values is not immediately available for reuse after the transaction is completed because Db2 handles storage in "extent" units. An extent is a set of contiguous data pages of a configurable size. Db2 can reclaim a storage extent for reuse only if all the data values in its pages were deleted or inserted elsewhere in an update operation. Storage extents whose pages contain many, but not all, deleted values are considered fragmented extents. In general, workloads with a high number of non-clustered updates or deletes can lead to the table having many highly fragmented extents, which causes storage usage to increase over time. Fragmentation can also cause query performance to degrade due to the extra I/O processing required to process data pages with many deleted values as well as new data pages resulting from inserts or updates that cannot reuse previous data pages.

In this technote, two stored procedures SYSTOOLS.ADMIN_COL_ANALYZE_FRAGMENTATION and SYSTOOLS.ADMIN_COL_DEFRAGMENT_TABLE are introduced to help users identify fragmented column-organized tables and then defragment them.

Document Location

Worldwide

[{"Line of Business":{"code":"LOB10","label":"Data and AI"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"ARM Category":[{"code":"a8m3p0000008uDiAAI","label":"BLU\/CDE-\u003EStorage"}],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"11.5.3;and future releases","Type":"MASTER"},{"Line of Business":{"code":"LOB76","label":"Data Platform"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSCJDQ","label":"IBM Db2 Warehouse"},"ARM Category":[{"code":"a8m3p0000008uDiAAI","label":"BLU\/CDE-\u003EStorage"}],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"11.5.3;and future releases","Type":"MASTER"},{"Line of Business":{"code":"LOB76","label":"Data Platform"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSCK3N","label":"IBM Db2 Warehouse on Cloud"},"ARM Category":[{"code":"","label":""}],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"11.5.3;and future releases","Type":"MASTER"},{"Type":"MASTER","Line of Business":{"code":"LOB76","label":"Data Platform"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSHRBY","label":"IBM Integrated Analytics System"},"ARM Category":[{"code":"a8m0z0000001hWTAAY","label":"IBM Integrated Analytics System-\u003EIIAS Software and Performance-\u003EPerformance"}],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"1.0.22;and future releases"}]

Log InLog in to view more of this document

This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.

Document Information

Modified date:
30 April 2025

UID

ibm16465559