Space reclamation for column-organized tables
When data is deleted from a column-organized table, the storage extents whose pages held deleted data are candidates for space reclamation. The space reclamation process finds these extents, and returns the pages that they hold to table space storage, where they can later be reused by any table in the table space.
You can start this process manually by specifying the RECLAIM EXTENTS option for
the REORG TABLE command, or you can use an automated approach. If you set the
DB2_WORKLOAD registry variable to ANALYTICS, a default policy
is applied, and the auto_reorg database configuration parameter is set so that
automatic reclamation is active for all column-organized tables. For
more information, see Enabling automatic table and index
reorganization
and Configuring an automated maintenance policy
.
You can monitor the progress of a table reorganization operation with the reorganization monitoring infrastructure. The ADMIN_GET_TAB_INFO table function returns an estimate of the amount of reclaimable space on the table, which you can use to determine when a table reorganization operation is necessary.
Space reclamation after deletions
Space reclamation after updates
When a row in a column-organized table is updated, the existing row is first deleted, and a new copy of the row is inserted at the end of the table. This means that an updated row uses space in proportion to the number of times that the row is updated until space reclamation occurs. All rows in the extent that contains an updated row must be deleted before the extent is reclaimed.
Space reclamation after automatic recompress for tables
The Automatic Recompress feature for tables uses the new compression daemon to asynchronously check tables that contain rows that were inserted before compression dictionary creation. It then recompresses those rows in place, leaving empty extents. These empty extents can be reclaimed later with REORG TABLE ... RECLAIM EXTENTS. The freed extents which are reclaimed can then be re-used by other tables in the same table space.