Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > IBM DB2 > Re: Column orde...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 6 Topic 9083 of 9520
Post > Topic >>

Re: Column order in composite index

by "Mark A" <nobody@[EMAIL PROTECTED] > Jul 13, 2008 at 11:19 PM

"Henry J." <tank209209@[EMAIL PROTECTED]
> wrote in message 
news:0a978bd0-26f9-492e-a868-921ffbc31cea@[EMAIL PROTECTED]
> I'm pretty new to DB2 and like to know if column cardinality can play
> a role in choosing the column order in a composite index.
>
> In Oracle, it appears composite indexes of different column orderings
> perform the same regardless of column cardinality (http://
> asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:
> 5671539468597):
>
>     ..... for a query that references all of A, B, C the above three
> indexes will perform more or less the same -- regardless of the
> selectivity of A, B, or C.  Benchmark in the book ;)
>
> In SQL Server, however, it is claimed that column ordering is very
> im****tant (http://www.mssqlcity.com/Tips/tipInd.htm):
>
>      If you create a composite (multi-column) index, try to order the
> columns in the key as to enhance selectivity, with the most selective
> columns to the leftmost of the key.
>
> Can anybody comment on what we should expect from DB2?  Is there any
> official info on this topic from IBM?  I tried but couldn't find much
> info on this topic from IBM.
>
> Thanks a lot.

So long as you supply all 3 columns of the index in the predicate, it 
doesn't make much of a difference in DB2. I doubt that it makes a
difference 
in SQL Server either (although I don't that for sure).

The problem is when you only supply values in the predicate for part of
the 
index, and even worse when you don't supply the leftmost columns of the 
index in the predicate (in which case the b-tree will not be used and a 
complete index scan will be used, or a table scan will be used).
 




 6 Posts in Topic:
Column order in composite index
"Henry J." <  2008-07-13 19:46:26 
Re: Column order in composite index
"Mark A" <no  2008-07-13 23:19:17 
Re: Column order in composite index
--CELKO-- <jcelko212@[  2008-07-14 08:02:02 
Re: Column order in composite index
"Mark A" <no  2008-07-14 14:32:43 
Re: Column order in composite index
--CELKO-- <jcelko212@[  2008-07-14 12:51:51 
Re: Column order in composite index
"Henry J." <  2008-07-15 19:37:07 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Dec 2 20:43:05 CST 2008.