Re: How to force use of index
Date: Wed, 19 Oct 1994 23:37:37 +0000
Message-ID: <84591455wnr_at_tarik.demon.co.uk>
In article: <37ud5t$eof_at_athos.cc.bellcore.com> mjk_at_spanky.cc.bellcore.com (25994-kelly) writes:
>
> Does anyone see why this doesn't work? I traced it and the statements
> still do a full tablescan ....
> select ticketnum from /*+INDEX CTRIEC*/
> open_trouble_info where
> ((center_lit = 0) and (customer_iec_code in (0)));
>
>
> select ticketnum from /*+CTRIEC*/
> open_trouble_info where
> ((center_lit = 0) and (customer_iec_code in (1,0)));
>
> The index is on center_lit+customer_iec_code.
>
>
Personally I'd try:
select ticketnum
from open_trouble_info
where center_lit = 0
and customer_iec_code in (1,0);
The problem could lie in that center_lit and customre_iec_code are CHAR's, hence the where clause should be:
where center_lit = '0'
and customer_iec_code in ('1', '0');
Hope that was it.
Larry Barea
(larry_at_tarik.demon.co.uk)
Received on Thu Oct 20 1994 - 00:37:37 CET