In the previous article, I explained how to create a table in D365 FO. In this article, I will explain how to set indexes on table. As we know tables are the core objects used to store data in Microsoft Dynamics 365. A table index increases the speed of the retrieval of data from a table. So, while creating a table don’t forget to set the index for the table. An index helps
- Increase the speed of the retrieval of rows from a table.
- Indexes are used to improve the performance of data retrieval.
- occasionally an index helps to ensure the existence of unique records.
- In D365 FO like other database objects, indexes are synchronized with the database.
- Hence, Once an index is created, indexes are managed automatically by the DBMS every time a record is inserted, updated, or deleted.
So here I am referring to the same table TblEmployee which was created in the previous article, you can refer to the article here.
Restore the structure of the table that we created in the previous article.
- It will create an index with the default name Index1.
- Right-click on Index1 and go to Properties.
- Rename the Index Name, here I renamed it to EmployeeIdx.
- Next, specify whether the index is unique or non-unique by doing one of the following:
- To specify that the index is a non-unique index, confirm that the AllowDuplicates property is set to Yes.
- It is recommended that you create non-unique indexes for optimum database performance.
- To specify that the index is unique, set the AllowDuplicates property to No.
- When the index is unique, you cannot insert records with duplicate key values.
- A warning is issued to the user if he attempts to insert records with duplicate values.
- To disable the index, set the Enabled property to No. When you disable an index, it is deleted from the database.
- You can also delete an index by right-clicking the index, and then click Delete.
- Before building the solution, please make sure that the Table property Synchronize Database on Build is set as True.