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.


|