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: optimizer AND_EQUAL problem

Re: optimizer AND_EQUAL problem

From: Leon Rzhemovskiy <lrzhemov_at_home.com>
Date: Sat, 30 Jan 1999 23:10:31 GMT
Message-ID: <36B390FE.BF185F41@home.com>


Thanks
I am agree with you. If I put "=" everything OK.

I have tried to start database in a CHOSE and RULE Mode. I have tried to run query with existing statistics for customer table and without.
Does not help.

I hope it is exists way to use 2 indexes for query like "like 'XXX%'" With using 1 index it is painfully slow. Need help.

Thanks
Leon

"John P. Higgins" wrote:

> I believe the AND-EQUAL method can only be used when you ask for an
> exact match on each of the keys.
>
> Leon Rzhemovskiy wrote:
>
> > I have table "customer". (200 000 MB)
> > 2 single indexes (last_name and first_name)
> >
> > Select statement:
> >
> > select /*+ AND_EQUAL (customer cust_last cust_first) */
> > count(*)
> > from CUSTOMER
> > where LASTNAME like 'J%'
> > and FIRSTNAME like 'M%'
> >
> > Result:
> >
> > Explain statement
> > - select statement
> > - sort aggregate
> > - table access by index rowid customer
> > Index range scan cust_first
> >
> > HOW to MAKE IT LIKE:
> >
> > - select statement
> > - sort aggregate
> > - and-equal
> > index range scan cust_first
> > index range scan cust_last
> >
> > Thanks
> > Leon
> > lrzhemov_at_home.com
Received on Sat Jan 30 1999 - 17:10:31 CST

Original text of this message

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