indexes

i have a question about indexes
if i create a index on 3 columns
int int int
id1 id2 id3

does SqlServer build the index from left to right based on the data in each
column

Tks
Mike
Dave P [ Do, 18 Oktober 2007 21:17 ] [ ID #1848139 ]

Re: indexes

MikeJ (analizer1 [at] yahoo.com) writes:
> i have a question about indexes
> if i create a index on 3 columns
> int int int
> id1 id2 id3
>
> does SqlServer build the index from left to right based on the data in
> each column

I'm not sure if I understand the question. Or even what left and right
might be in this context.

But if have these 8 rows:

id1 id2 id3
12 1 -2
12 1 23
12 2 9
12 2 19
14 145 1992
15 -2 4711
15 -2 4712
15 6 0

The rows will appear in the index in that order.

--
Erland Sommarskog, SQL Server MVP, esquel [at] sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downlo ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books .mspx
Erland Sommarskog [ Do, 18 Oktober 2007 23:22 ] [ ID #1848146 ]
Datenbanken » comp.databases.ms-sqlserver » indexes

Vorheriges Thema: Run SQL script on Instance Startup
Nächstes Thema: Student needs help with editions