What will be the best practice to use Index in Entity

0
Dear all ,   we are getting suggestion from Mx Assist Performance Bot to use the Index on attribute we use in Xpath,   when adding index mendix has 2 option 1) add Index attribute in group 2) add Index independently   so my question is which one is more efficient ?    
asked
2 answers
2

Hello Harshad,

 

First of all, it really depends on your situation and how big your dataset is and how different or homogenouos your data is. 

With only one attribute as index and your retrieve mainly and basically on this attribute it can give already a huge performance increase.

The adding of one or two attributes to your index can still give you better results but the marginal benefits decrease with every extra attribute you set.

 

You can just create an example by hand where you Order your data with your index and then you can conclude what the most optimal set up is.

 

For Example Something like this

 

image.png

 

Just take a good luck at your retrieve and sample demo it with a simple example in excel, and ofcourse after implementing always check if it really increases your performance in some cases an index hurts more than it benefits you, especially with a more delete create actions than retrieve actions.

 

See also 

https://docs.mendix.com/refguide/indexes/

answered
1

FYI: A couple of links to Learning Paths covering this topic

 

https://academy.mendix.com/link/modules/385/lectures/3111/5.1-Different-Ways-to-Optimize-XPath-Queries

https://academy.mendix.com/link/modules/371/lectures/3016/4.6-What-Are-Indexes

answered