Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: cost of index range scan
On Mon, 15 May 2006 07:09:37 -0700, jernigam_at_kochind.com wrote:
> If I just do
> select * from table_a
> where acct_date >= :b1
>
> Then I get a ix_sel of .009. I would think that this would be .05.
Your first value may have been such that it was .009. You know about the bind variable peeking? CBO takes a look in the bind variable when it parses the statement for the 1st time and that is what defines the selectivity of the index in this particular query. Personally, I hate bind variable peeking as it introduces the element of randomness: whatever you look at the beginning will determine your plan afterward. Philosophically speaking, it introduces the uncertainty principles into databases. Even if God does play dice, Larry Ellison definitely shouldn't.
-- http://www.mgogala.comReceived on Mon May 15 2006 - 10:41:47 CDT