Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Concatenated Index
Steve Johnson wrote:
> 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
EXPLAIN PLAN
SET statement_id = 'abc'
FOR
SELECT count(*)
FROM tablea,
tableb
WHERE tablea.a like 'AB%'
AND tablea.b=tableb.b
AND tablea.c=tableb.cl;
Then ...
SELECT LPAD(' ',2*(level-1)) || operation || ' ' || options ||' ' ||
object_name || ' ' ||
DECODE(id,0,'Cost = '||position) QUERY_OUTPUT
FROM plan_table
START WITH id = 0
AND statement_id = 'abc'
CONNECT BY PRIOR id = parent_id
AND statement_id = 'abc';
This will take less time than posting the question to usenet.
Daniel Morgan Received on Tue Jun 04 2002 - 14:53:29 CDT