JohnDTampaBay
Programmer
I was told recently that SQL Server can read an index in forward and reverse order. For a single column index, its simple enough. 1,2,3 can be read 3,2,1.
But what about multi-column indexes? I was told SQL Server can read an index's columns in reverse order. So an index built on State then City, could be read as City then State. If the data were...
Detroit, MI
Birmingham, AL
Tampa, FL
The indexStateCity would be read...
AL Birmingham
FL Tampa
MI Detroit
But SQL Server could also read it as...
Birmingham AL
Detroit MI
Tampa FL
I'm not sure that I buy it. Can anyone confirm or deny this? I can't find anything on MSDN on reverse indexes or the like. Any help?
--John![[rainbow] [rainbow] [rainbow]](/data/assets/smilies/rainbow.gif)
-----------------------------------
Behold! As a wild ass in the desert
go forth I to do my work.
--Gurnie Hallock (Dune)
But what about multi-column indexes? I was told SQL Server can read an index's columns in reverse order. So an index built on State then City, could be read as City then State. If the data were...
Detroit, MI
Birmingham, AL
Tampa, FL
The indexStateCity would be read...
AL Birmingham
FL Tampa
MI Detroit
But SQL Server could also read it as...
Birmingham AL
Detroit MI
Tampa FL
I'm not sure that I buy it. Can anyone confirm or deny this? I can't find anything on MSDN on reverse indexes or the like. Any help?
--John
![[rainbow] [rainbow] [rainbow]](/data/assets/smilies/rainbow.gif)
-----------------------------------
Behold! As a wild ass in the desert
go forth I to do my work.
--Gurnie Hallock (Dune)