Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle does not choose proper Index
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