D.16RDB$INDICES

RDB$INDICES stores definitions of both system- and user-defined indexes. The attributes of each column belonging to an index are stored in one row of the table RDB$INDEX_SEGMENTS.

Column NameData TypeDescription

RDB$INDEX_NAME

CHAR(31)

The unique name of the index specified by the user or automatically generated by the system

RDB$RELATION_NAME

CHAR(31)

The name of the table to which the index belongs. It corresponds to an identifier in RDB$RELATION_NAME.RDB$RELATIONS

RDB$INDEX_ID

SMALLINT

The internal (system) identifier of the index

RDB$UNIQUE_FLAG

SMALLINT

Specifies whether the index is unique:

0 - not unique 1 - unique

RDB$DESCRIPTION

BLOB TEXT

Could store comments concerning the index

RDB$SEGMENT_COUNT

SMALLINT

The number of segments (columns) in the index

RDB$INDEX_INACTIVE

SMALLINT

Indicates whether the index is currently active:

0 - active 1 - inactive

RDB$INDEX_TYPE

SMALLINT

Distinguishes between an ascending (0 or NULL) and descending index (1). Not used in databases created before Firebird 2.0; hence, indexes in upgraded databases are more likely to store NULL in this column

RDB$FOREIGN_KEY

CHAR(31)

The name of the primary or unique key index referenced by the foreign key backed by this index; NULL if this index is not used by a foreign key.

RDB$SYSTEM_FLAG

SMALLINT

Indicates whether the index is system-defined or user-defined:

0 - user-defined 1 or greater - system-defined

RDB$EXPRESSION_BLR

BLOB BLR

Expression for an expression index, written in the binary language representation (BLR), used for calculating the values for the index at runtime.

RDB$EXPRESSION_SOURCE

BLOB TEXT

The source code of the expression for an expression index

RDB$STATISTICS

DOUBLE PRECISION

Stores the last known selectivity of the entire index, calculated by execution of a SET STATISTICS statement over the index. It is also recalculated whenever the database is first opened by the server. The selectivity of each separate segment of the index is stored in RDB$INDEX_SEGMENTS.