This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
||||||||||||||
|
4D v20 R7
CREATE INDEX
|
|
||
The CREATE INDEX command is used to create an index (sql_name) on one or more columns of an existing table (sql_name) designated by one or more column_reference type arguments. Indexes are transparent to users and serve to speed up queries.
Note: The UNIQUE attribute is not supported for indexes by the 4D SQL engine. It can be passed to CREATE INDEX for compatibility with generic SQL scripts (no error is generated), but it will be ignored. Use UNIQUE keyword in column_definition of CREATE TABLE to disallow duplicate values in a column.
Since this command modifies the database structure, it cannot be used in the context of a read-only packaged application (.4dc file installed in the Program Files folder or .4dz file).
Here is a simple example for creating an index:
CREATE INDEX ID_INDEX ON ACTOR_FANS (ID)
Product: 4D
Theme: SQL Commands
4D SQL Reference ( 4D v20 R7)