index estimate_compression argument: Estimate index compression (SQL administration API)

Use the index estimate_compression argument with the admin() or task() function to estimate if you can save disk space by compressing a B-tree index.

Syntax: index estimate_compression command argument

EXECUTE FUNCTION { admin | task } ("index estimate_compression " , "index_name", "database_name","owner" );

Command elements

The following table shows the elements that you can use to estimate index compression.

Table 1. Index estimate_compression command elements
Element Description Key Considerations
index_name The name of the index for which you want to estimate compression benefits. Required.

You must use the same uppercase or lowercase letters that are in system catalog tables.

database_name The name of the database that contains the index. Optional.

If you do not specify a database, the database server uses the current database.

If you enter a database name, you must use the same uppercase or lowercase letters that are in system catalog tables.

owner The name of the owner of the database that contains the index. Optional for an index.

If you do not specify an owner, the database server uses the current owner.

If you enter an owner name, you must use the same uppercase or lowercase letters that are in system catalog tables.

Usage

You can estimate compression only for a detached B-tree index on a fragmented or non-fragmented table.

The estimate compression operation displays the name of the index, the estimated compression ratio that can be achieved, the current compression ratio, and an estimate of the percentage gain or loss. The current ratio is 0.0 percent if the index is not compressed.

Example

The following command estimates compression benefits for an index named ind4 in the customer database for which anjul is the owner.

EXECUTE FUNCTION task("index estimate_compression","ind4",
"customer","anjul");