Re: How the optimizer handles a range of values

From: mohamed houri <mohamed.houri_at_gmail.com>
Date: Thu, 20 Dec 2012 10:33:43 +0100
Message-ID: <CAJu8R6jztbwworKV2KPcbv5DYEgdM5kdhJFF3NNuCuEDSxzOuQ_at_mail.gmail.com>



Hello,
And what is the definition of the other index your query is desiring(prefering)?

The clustering factor of the unpicked index and the preferred one might play a role here in your case.

Best regards
Mohamed Houri
www.hourim.wordpress.com

2012/12/20 Steve Wales <sjwales_at_comcast.net>

> I'm doing some analysis of a query and looking at the indexes vs the query.
>
> The table has several indexes and one of them is on district+period+a few
> other columns.
>
> The query is doing this:
>
> where district = 'ABC'
> and period between '201210' and '201211'
>
> I'm wondering (and the execution plan's really not showing my much here, it
> still is picking up a completely different index anyway, which I can't
> explain yet) if there's any difference between this:
>
> where district = 'ABC'
> and period between '201210' and '201211'
>
> and this:
>
> where district = 'ABC'
> and period >= '201210'
> and period <= '201211'
>
> Been talking to Google, but haven't found anything yet.
>
> (Oh we're talking Oracle 9207 on HPUX 11.11)
>
> Thanks
> Steve
>
> --
> http://www.freelists.org/webpage/oracle-l
>
>
>

-- 
Bien Respectueusement
Mohamed Houri


--
http://www.freelists.org/webpage/oracle-l
Received on Thu Dec 20 2012 - 10:33:43 CET

Original text of this message