Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reverse indexes

Status
Not open for further replies.

JohnDTampaBay

Programmer
Jul 12, 2002
986
US
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]
-----------------------------------
Behold! As a wild ass in the desert
go forth I to do my work.
--Gurnie Hallock (Dune)
 
The 1,2,3 vs 3,2,1 is just sort order. The city and state example is totally different. FWIW, I haven't seen or heard anything regarding what you suggest.
-Karl

[red] Cursors, triggers, user-defined functions and dynamic SQL are an axis of evil![/red]
[green]Life's uncertain...eat dessert first...www.deerfieldbakery.com[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top