Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Concatenated Index
The "like" clause ensures that everything you need from tablea
is in the index, so I think your query will only access the index
not tablea. But it doesn't gauranttee a fast index scan. That
depends on the number of records which match the 'AB%' criterion.
Even if index scan is fast, the join can be slow. How large is
tableb, does it have an index on column b and c, and what's the
cardinality on these two columns?
"Steve Johnson" <johnst_at_ncs.com> wrote in message news:<ufq5u6am03kmcb_at_corp.supernews.com>...
> If I have a concatenated index on tablea columns (a, b, c) and a query:
>
> SELECT count(*)
> FROM tablea,
> tableb
> WHERE tablea.a like 'AB%'
> AND tablea.b=tableb.b
> AND tablea.c=tableb.c
>
> Will columns b and c of the index on tablea be used in the query? It uses
> the index like I wanted but I don't get the speed I think I should which
> leads me to believe that it doesn't.
>
> Any help would be appreciated.
>
> Thanks...
> Steve
Received on Tue Jun 04 2002 - 23:34:36 CDT