Indexes in database are used to locate records, They are stored separately in the database and contains a key that can be quickly located in the index and the reference to the record.
There are two types of index;
- Unique
- Non- Unique
In a unique key it ensures that no duplicate value occurs in the column.
Non-Unique key provide quick o retrieving data, instead of performing full table search of all the records in a table.
Primary Index:
A primary index is a unique index for a table that defines the primary key for that table.
To set the index as unique index, set the property Allow duplicate to 'NO'.
Clustered Index:
It is a physical order in which the records are stored in a table.
In clustered index on a text field called "Name" and you insert a record with a letter 'D', the record will physically be inserted between C and E record.
Clustered index do not have to be unique.
Surrogate key;
When a primary index is not specified, Ax uses a surrogate key as primary index
The RecId is the key that is used as surrogate key
The surrogate key is used on many relations between tables.