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 3 of 6 Topic 9083 of 9349
Post > Topic >>

Re: Column order in composite index

by --CELKO-- <jcelko212@[EMAIL PROTECTED] > Jul 14, 2008 at 08:02 AM

>>  I doubt that it makes a difference in SQL Server either (although I
don't that for sure). <<

Unfortunately, it does.  SQL Server uses a simple B-tree, so you get a
different depth of tree with (state_code, city_name) versus
(city_name, state_code).  They concatenate the columns in the order
given, so if the state_code appears first, you get a "tall, deep tree"
for the index.  If you give the city_names first, you get a "flat,
wide tree" for the index.  The heuristic is to start with the column
with the most values in its range.
 




 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 Oct 7 4:56:36 CDT 2008.