Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: optimizer AND_EQUAL problem
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 - 15:07:46 CST
![]() |
![]() |