PQL Create Index

PQL CREATE INDEX Statement
The CREATE INDEX statement is used to create indexes in stables. Indexes allow the database application to find data fast; without reading the whole stable.

Indexes
An index can be created in a stable to find data more quickly and efficiently. The users cannot see the indexes, they are just used to speed up searches/queries. Note: Updating a stable with indexes takes more time than updating a stable without (because the indexes also need an update). So you should only create indexes on columns (and tables) that will be frequently searched against.

PQL CREATE INDEX Syntax
Creates an index on a stable. Duplicate values are allowed:

PQL CREATE UNIQUE INDEX Syntax
Creates a unique index on a stable. Duplicate values are not allowed:

Note: The syntax for creating indexes varies amongst different databases. Therefore: Check the syntax for creating indexes in your database.

CREATE INDEX Example
The PQL statement below creates an index named "PIndex" on the "LastName" column in the "Ponies" stable:

If you want to create an index on a combination of columns, you can list the column names within the parentheses, separated by commas: