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: Using Index

Re: Using Index

From: John Higgins <JH33378_at_deere.com>
Date: Mon, 26 Apr 1999 20:59:08 -0500
Message-ID: <372519EC.6CAC5E@deere.com>


You mis-understood your DBA. He actually said the SQL should be:

select name from table_a
where ID_NO = 'xxx'
and name > ' ';

This should be index-only!

Andrew Babb wrote:

> Julia,
>
> One point against the DBA, One point for yourself.
>
> Yes, to use a concatenated index, you must provide the leading columns of the
> concatenated index.
>
> If you need to prove this, then you can run the SQL Statement in SQL*Plus but
> also use;
>
> set autotrace on explain
>
> You will need to create the Plan Table $ORACLE_HOME/rdbms/admin/utlxplan first.
>
> Andrew
>
> Julia Cristina Varela de Montoya wrote:
>
> > Can you settle a bet with our beloved DBA? He says that if a table_a:
> >
> > name
> > ID_No
> > Province
> >
> > has an lone index on (name,ID_NO). Then if we have
> >
> > sekect name from table_a
> > "where ID_NO = 'xxx' ;
> >
> > then that it will use the index. That doesn't sound right to me.. I
> > thought ID_NO would have to be on the leading edge of the index. Thanks for
> > any help.
Received on Mon Apr 26 1999 - 20:59:08 CDT

Original text of this message

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