RECLAIM

Use the RECLAIM statement to reclaim disk space currently occupied by records stored in Kognitio internal storage that have been deleted or rolled back in transactions. This process maximizes available free disk space. See recovering disk space for more indepth details on RECALIM.

Usage

RECLAIM [FOR PARTITION {slab_id} ...] TO {NOW | BEGIN}

Notes

Kognitio also provides an automated background repackaging mechanism as an alternative to the RECLAIM command.

Individual slabs might be specified if there is only a small daily reclaim window available meaning a different set of slabs have to be reclaimed each night; alternatively you may wish to target an individual slab because you have deleted a significant number of records from it, for example, you may have deleted old logging records from the logging slab.

Both RECLAIM TO BEGIN and RECLAIM TO NOW run as a Global Session Reclaim (GSR)— the session running the command must have a global lock.

A reclaim may take several hours to complete, Kognitio recommends that you timetable reclaims on a regular basis, and run them overnight or at week-ends.

The sole difference between RECLAIM TO BEGIN and RECLAIM TO NOW is that

  • RECLAIM TO BEGIN only reclaims information that can never be used again, for example, “delete” and “transaction complete” markers from completed transactions, and rolled-back rows. For this reason, it is rarely used.

  • RECLAIM TO NOW reclaims all non-current information from completed transactions, for example, everything that RECLAIM TO BEGIN would reclaim, plus deleted/updated rows and dropped tables. This form of RECLAIM is the one normally used.

The optional FOR PARTITION {slab_id} ... allows you to run a reclaim on a subset of the disk slabs available on the system.

For more information on RECLAIM, see recovering disk space.

Example 1: Global Session Reclaim

Perform a Global Session Reclaim (GSR):

LOCK SYSTEM
RECLAIM TO NOW

Remember that a CREATE IMAGE command automatically obtains a global lock, so the following would run as a GSR:

CREATE IMAGE
RECLAIM TO NOW

Example 2: Global Session Reclaim of Specific Slabs

Perform a Global Session Reclaim (GSR) of specific slabs:

LOCK SYSTEM
RECLAIM FOR PARTITION 3 4 TO NOW