141
Views
3
Comments
Solved
Purpose of Index
Application Type
Traditional Web

Hi,

Can anyone help me with the actual purpose of index when its unique property set to "No"?

I am aware that it is used for quick retrieval of data. Is it act like a filter? 

2021-09-06 15-09-53
Dorine Boudry
 
MVP
Solution

Hi @Xavior ,

Indexes are a database tool, not specific to Outsystems, and can be thought of pretty much like an index of words at the end of a book.

If you filter on any given value for one of your attributes, having that index in place will help you find the rows (pages in the book) much faster than having to go through each row (page).

But the content of a database changes often (unlike the pages of a printed book), and every time you update/create/delete any data, the dbms also has to update the relevant parts of all indexes defined for your entity.

So faster retrieval IF sorted or filtered on relevant attribute, slower updating, your job as a developer is to weigh these and choose wisely.

Dorine

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

In general though, data is retrieved way more often than it is stored, except maybe for stuff like logging, so in general, if you are filtering on a value often, an index should be considered.

Also note that foreign keys will be automatically given an index by Service Studio.

2025-05-11 04-57-37
Somesh Renganathan

Hi Xavior,

Please check the below documentation: https://success.outsystems.com/Documentation/11/Developing_an_Application/Use_Data/Data_Modeling/Create_an_Entity_Index

2021-09-06 15-09-53
Dorine Boudry
 
MVP
Solution

Hi @Xavior ,

Indexes are a database tool, not specific to Outsystems, and can be thought of pretty much like an index of words at the end of a book.

If you filter on any given value for one of your attributes, having that index in place will help you find the rows (pages in the book) much faster than having to go through each row (page).

But the content of a database changes often (unlike the pages of a printed book), and every time you update/create/delete any data, the dbms also has to update the relevant parts of all indexes defined for your entity.

So faster retrieval IF sorted or filtered on relevant attribute, slower updating, your job as a developer is to weigh these and choose wisely.

Dorine

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

In general though, data is retrieved way more often than it is stored, except maybe for stuff like logging, so in general, if you are filtering on a value often, an index should be considered.

Also note that foreign keys will be automatically given an index by Service Studio.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.