Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Key Compression vs. Selectivity

Re: Key Compression vs. Selectivity

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Mon, 18 Dec 2006 19:22:55 -0000
Message-ID: <qvCdnfYIxqIRdxvYnZ2dnUVZ8qijnZ2d@bt.com>

<hasta_l3_at_hotmail.com> wrote in message news:1166423707.587373.30730_at_80g2000cwy.googlegroups.com... Jonathan Lewis a écrit :
> "Robert Klemme" <shortcutter_at_googlemail.com> wrote in message
> >
> > The general rule of thumb for indexing is to put the most selective
> > columns first in order to foster fast lookups. (Of course there are
> > other considerations involved, which single index covers most queries
> > etc.)
>
> The "most selective first" has always been a little
> flexible (at least since 6.0 appeared)

Jonathan and Robert....

Why would the rule of thumb "put the most selective column first" be a good one to any degree ?

(let's assume that permutations of index columns don't impact the number of queries covered)

In passing - there is at least one (slightly convoluted) special case where "most selective first" is a good idea, as it allows the optimizer to generate a plan that CAN use the index, and any other alternative makes things inefficient. I'll probably blog about it some time, but it's not generally very useful to make a fuss about it.

-- 
Regards

Jonathan Lewis
http://jonathanlewis.wordpress.com

Author: Cost Based Oracle: Fundamentals
http://www.jlcomp.demon.co.uk/cbo_book/ind_book.html

The Co-operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/faq/ind_faq.html
Received on Mon Dec 18 2006 - 13:22:55 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US