Defining index space storage

Generally, the CREATE INDEX statement creates an index space in the same Db2 database that contains the table on which the index is defined, even if you defer building the index.

Exceptions:
  • If you specify the USING VCAT clause for indexes that are not created on the Db2 catalog, you create and manage the data sets yourself.
  • If you specify the DEFINE NO clause on a CREATE INDEX statement with the USING STOGROUP clause, Db2 defers the allocation of the data sets for the index space.

Procedure

Begin general-use programming interface information.To define your index space storage:

Issue a CREATE INDEX statement.

Optionally, for indexes that are not on Db2 catalog tables, include the USING clause to specify whether you want Db2-managed or user-managed data sets. For Db2-managed data sets, you can also specify the primary and secondary space allocation parameters for the index or partition in the USING clause. If you do not specify USING, Db2 assigns the index data sets to the default storage groups with the default space attributes.

For indexes on Db2 catalog tables, Db2 defines and manages the index data sets. The data sets are defined in the same SMS environment that is used for the catalog data sets with default space attributes. If you specify the USING clause for indexes on the catalog, Db2 ignores that clause.

End general-use programming interface information.

Results

Information about space allocation for the index is stored in the Db2 catalog table SYSIBM.SYSINDEXPART. Other information about the index is in the SYSIBM.SYSINDEXES table.