Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   Consolidating Table Storage Spaces Online >

Repack Threads

Certain operations on existing tables, such as INSERT statements that use light appends to add new extents when space is available in existing extents, or DELETE operations that remove most of the rows from one or more extents, can cause tables that contain relatively few rows to occupy a large quantity of storage space. After an extent has been allocated to a table or fragment, however, the extent remains allocated until the table is dropped or truncated. This can result in inefficient use of disk space, if a small amount of data sparsely occupies a large amount of storage.

This feature of Extended Parallel Server 8.51 enables users to "repack" a table by shifting data with the highest ROWID values to empty slots at lower ROWID values. At the end of the repack operation, any pages beyond the last used page in the table can be freed. This is implemented by methods that allow other users to modify the table while the operation proceeds. Any pending in-place alters are applied to rows as they are moved, so not only are rows packed together more tightly, but their format is also brought up to date.

After the row-moving phase is complete, the database server starts the next phase of deallocating empty extents. It examines each extent of the table in reverse order, beginning with the last extent and proceeding towards the first. Any completely empty extent is freed, making it available within the dbspace. When this process encounters the last used page, the partially empty extent that contains this page is truncated, so that the last used page also becomes the last allocated page, and the repacking operation terminates.

Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]