Talk About Network

Google





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

Re: Column order in composite index

by "Henry J." <tank209209@[EMAIL PROTECTED] > Jul 15, 2008 at 07:37 PM

so everybody agrees it doesn't matter in DB2?

On Jul 14, 11:02 am, --CELKO-- <jcelko...@[EMAIL PROTECTED]
> wrote:
> >>  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
localhost-V2008-12-19 Wed Jan 7 21:57:46 PST 2009.