Saturday, 22 November 2014

Index in Ax2012

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;
  1. Unique
  2. 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.


1 comment:

  1. In the above u mean to say
    Unique index are Primary index and Surrogate where
    Non-Unique index is a Clustered index ?

    Does AOT table element properties are similar to SQL table properties.
    if not what will be the default index in AOT object ?

    ReplyDelete