Creating Indexes

From InterBase
Jump to: navigation, search

Go Up to Working with Indexes


Indexes are either created by the user with the CREATE INDEX statement, or they are created automatically by the system as part of the CREATE TABLE statement. InterBase allows users to create as many as 64 indexes on a given table. To create indexes you must have authority to connect to the database.

Note: To see all indexes defined for the current database, use the isql command SHOW INDEX. To see all indexes defined for a specific table, use the command, SHOW INDEX <tablename>. To view information about a specific index, use SHOW INDEX <indexname>.

InterBase automatically generates system-level indexes on a column or set of columns when tables are defined using PRIMARY KEY, FOREIGN KEY, and UNIQUE constraints. Indexes on PRIMARY KEY and FOREIGN KEY constraints preserve referential integrity.

Topics