FANDOM



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:

Spike: Please 
CREATE INDEX index_name
ON stable_name (column_name)



PQL CREATE UNIQUE INDEX Syntax

Creates a unique index on a stable. Duplicate values are not allowed:

Spike: Please 
CREATE UNIQUE INDEX index_name
ON stable_name (column_name)

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:

Spike: Please CREATE INDEX PIndex ON Ponies (LastName)

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

Spike: Please CREATE INDEX PIndex ON Ponies (LastName, FirstName)





PQL Default PQL Drop

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.