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: Where question

Re: Where question

From: fumi <fumi_at_tpts5.seed.net.tw>
Date: 14 Oct 1999 16:51:30 GMT
Message-ID: <7u51mi$gbu$12@news.seed.net.tw>

> Mario Yepes <pafu_at_hotmail.com> wrote in message
news:3804A345.89870870_at_hotmail.com...
> Hi !!
> I have an idiot question, suppose that I have a table with these fields:
> empl_id, name, address, zipcode, salary
> And an index by empl_id, salary
> How I should use the where clause to "take or use" that index
> where empl_id = 'xxx'
> and salary > 10000;
> or
> where salary > 10000;
> and empl_id = 'xxx';
> Regards,
> Diego

Both work.
The order of the conditions is negligible. The only point is you must refer the leading column(s) of the composite index and leave the column name unmodified.

Many self-declared veterans, even some books (for example, the tumid book <<Oracle certified professional: DBA certification exam guide, Oracle Press>>, I wish I had not bought it.... :( ) say that the order of composite index and the conditions must be consistent. This assertion is not true and sound absurd. It can be simply approved by EXPLAIN PLAN. Received on Thu Oct 14 1999 - 11:51:30 CDT

Original text of this message

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