sp_iqindex and sp_iqindex_alt Procedures

Lists information about indexes.

Syntax 1

sp_iqindex ( [ table_name ],[column_name ],[table_owner ] )

Syntax 2

sp_iqindex [table_name='tablename' ],
[column_name='columnname' ],[table_owner='tableowner' ]

Syntax 3

sp_iqindex_alt ( [ table_name ],[column_name ],[table_owner ] )

Syntax 4

sp_iqindex_alt [table_name='tablename' ],
[column_name='columnname' ],[table_owner='tableowner' ]

Privileges

No specific system privilege is required to run these procedures.

Usage

Parameters

Parameter

Description

Syntax1

If you do not specify either of the first two parameters, but specify the next parameter in the sequence, you must substitute NULL for the omitted parameters. For example, sp_iqindex NULL,NULL,DBA and sp_iqindex Departments,NULL,DBA.

Syntax2

You can specify the parameters in any order. Enclose them in single quotes.

Syntax 3 and 4

Produces slightly different output when a multicolumn index is present. Allows the same options as Syntax 1 and 2.

Description

Displays information about indexes in the database. Specifying one of the parameters returns the indexes from only that table, column, or tables owned by the specified user. Specifying more than one parameter filters the results by all of the parameters specified. Specifying no parameters returns all indexes for all tables in the database.

sp_iqindex and sp_iqindex_alt columns

Column name

Description

table_name

The name of the table

table_owner

The owner of the table

column_name

The name of the column; multiple names can appear in a multicolumn index

index_type

The abbreviated index type (for example, HG, LF)

index_name

The name of the index

unique_index

'U' indicates the index is a unique index; otherwise, 'N'

location

TEMP = IQ temporary store, MAIN = IQ store, SYSTEM = catalog store

remarks

User comments added with the COMMENT statement

sp_iqindex always produces one line per index. sp_iqindex_alt produces one line per index per column if there is a multicolumn index.

Related reference
sp_iqcolumn Procedure
sp_iqconstraint Procedure
sp_iqdatatype Procedure
sp_iqevent Procedure
sp_iqhelp Procedure
sp_iqpkeys Procedure
sp_iqprocparm Procedure
sp_iq_reset_identity Procedure
sp_iqtable Procedure
sp_iqview Procedure