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: Oracle does not choose proper Index

Re: Oracle does not choose proper Index

From: Pritam <pritamr_at_hotmail.com>
Date: 21 Jul 2005 08:30:28 -0700
Message-ID: <1121959828.521335.30930@g43g2000cwa.googlegroups.com>


Jonathan,

I am using Bind variable in where clause and Value of that bind variable is always 'I'. To make query simple, in my second post, I just submitted the value in place of bind variable.

Query1 has 1 million rows satisfying the where clause but because of the FIRST_ROWS hint response is faster and returns result set fast (though it actually does not return the whole 1 million rows.)

Query2 actually has only 2 rows satisfying the where clause. But since Oracle optimizer sorts the whole 1Million rows first and then filters, it is taking long time.

I will try to create histogram on STATUS column and see what happens.

Thanks. Received on Thu Jul 21 2005 - 10:30:28 CDT

Original text of this message

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