Nonclustered index performance for different column types

Is a non-clustered index in an int column more productive than one in a decimal or datetime column?

+4
source share
1 answer

In a sense: yes.

An INT is only 4 bytes - so more than INT will fit on a single 8K page in SQL Server.

DATETIME uses 8 bytes - therefore less DATETIME values ​​are stored on one page or for the same number of DATETIME s, you need more pages, therefore, you get more disk I / O and therefore less performance.

How different from the difference is, to a more detailed measurement, however - for something under millions of lines, the difference is likely to be careless. If your queries benefit from the index in the DATETIME column, I would add it without hesitation (again: if you are not dealing with multi-million row tables ... then you may need more detailed research)

+4
source

All Articles