microsoft / ALAppExtensions

Repository for collaboration on Microsoft AL application add-on and localization extensions for Microsoft Dynamics 365 Business Central.
MIT License
780 stars 617 forks source link

Missing SumIndexFields for Service Line Table 5902 Primary Key #17176

Closed Teming closed 2 years ago

Teming commented 2 years ago

From NAV 14, we could see several SumIndexFields for the primay key of Service Line table 5902. It seems that they are missing for the later BC versions.

NAV 14. image

BC 19 for the same table - image

Is it possible? Thanks very much.

RadoArvay commented 2 years ago

Why do you need them there?

AlexanderYakunin commented 2 years ago

There is no need for SIFT on primary key, we even have special code cop rule to prevent it.

https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/analyzers/codecop-aa0222

dzzzb commented 2 years ago

Some elaboration on why not would be nice - the warning could link to the relevant BC page, which should be updated with info on why it's not useful anymore - I guess because the Classic database engine benefited from SumIndexFields on PKs but SQL Server for some reason does not. I can't quickly find any info on why this isn't needed/desirable anymore. It would be nice to.

RadoArvay commented 2 years ago

Record selectivity on PK index and amount summary (number of records that is calculated from) are identical. And SQL can do SUM on PK by scan quickly. You could define SumIndexFields but you should set the SIFTMaintanance property (or how it is called) to false value.