Hello,
I'm a bit confused about the usage of the index parameter in x++ select statements :
I always thought specifying an index will make the sql statement use that specific index. In the past I improved the performance of certain operations by adding indexes and 'using' them in the statement and witnessed dramatic performance gains. Not sure if this was because of adding the index on the table or specifying it in the statement. Recently, I'm seeing a lot of code that does not specify any indexes in the select/while select statements and I started wondering why so many people are not using indexes and thought this can't be just negligence.
The first thing I learned is that not INDEX but INDEX HINT actually enforces usage of a specific index. However, I also learned that HINT is also deprecated.
docs.microsoft.com/.../deprecated-x-index-hint-clause
According to Microsoft, the index only affects the order of the records returned :
https://docs.microsoft.com/en-us/dynamicsax-2012/developer/index-and-order-by-in-select-statements
If the conclusion is that a INDEX parameter on X++ sql statement does not help to decide on what index to use, how does X++ actually use the indexes for performance ? Does it pick them automatically based on what's the criteria in the where clause ?
Thanks