Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Continued Thread: Why would an index ignore a hint?

Re: Continued Thread: Why would an index ignore a hint?

From: Thomas Kyte <tkyte_at_oracle.com>
Date: 14 Feb 2005 14:07:27 -0800
Message-ID: <118418847.00015447.073@drn.newsguy.com>


In article <42111dd1$0$86894$c30e37c6_at_ken-reader.news.telstra.net>, Craig & Co. says...
>
>Thomas Kyte wrote:
>>
>>
>> Maybe your table has the status defined as a string and you are storing
>numbers
>> in strings. And this is causing a conversion at runtime.
>>
>
>BINGO !!!!
>
>The lookup status is a VARCHAR2, apparently the developers are following a
>standard
>that a third party used.
>Changed the query from
>SELECT /*+ INDEX (MESSAGE_DETAILS EXP_MSG_STATUS_IDX) */ *
>FROM MESSAGE_DETAILS
>WHERE expected_message_status = 11;
>
>SELECT /*+ INDEX (MESSAGE_DETAILS EXP_MSG_STATUS_IDX) */ *
>FROM MESSAGE_DETAILS
> WHERE expected_message_status = TO_CHAR('11');
>
>Thank you very much Thomas.
>
>Craig.
>
>

select *
  from message_details
 where expected_Message_status = '11'

is what you are looking for though, no hint, no redundant to_char()

-- 
Thomas Kyte
Oracle Public Sector
http://asktom.oracle.com/
opinions are my own and may not reflect those of Oracle Corporation
Received on Mon Feb 14 2005 - 16:07:27 CST

Original text of this message

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