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: Why is optimizer choosing this index?

Re: Why is optimizer choosing this index?

From: Mark and Karen Nolte <mknolte_at_megsinet.net>
Date: 2 Jul 1998 02:51:44 GMT
Message-ID: <01bda562$8b80e420$LocalHost@mknolte>

> where a= ...., date between .... and .... and not
> (b like ....) and (c = ... or c = ... or c = ...)
>

The 'between', 'like' and 'or' clauses either discourage or prevent (not sure) the optimizer from using the index.
>
> Is this performing a bounded range search on the
> indexed columns, even though only there are indexed
> columns between the leading column and the range?
> It would be expected that it would perform slowly,
> filtering on only one column. But it is very fast.
> Plus, the cost based optimizer chooses a different
> path,(Full Scan) and is much slower.
>

I would guess that you haven't used 'analyze' on the table if cost based chooses a full table scan. Unless column 'a' has very low cardinality (say less than 20 values) but then the difference in speed wouldn't be that great. Received on Wed Jul 01 1998 - 21:51:44 CDT

Original text of this message

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