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 -> using bind variables makes the optimizer choose a bad plan

using bind variables makes the optimizer choose a bad plan

From: prunoki <hegyvari_at_ardents.hu>
Date: 8 Sep 2005 04:58:28 -0700
Message-ID: <1126180708.428528.259710@g14g2000cwa.googlegroups.com>


Hi,

Given the query:

select * from carhitelszerzodesek where flotta_id=:1

The plan is table access full, though we have an index on flotta_id. Flotta_id is numeric, the table is analyzed with all columns, all indexes. If I hard code the value

select * from carhitelszerzodesek where flotta_id=0 is table access full.

select * from carhitelszerzodesek where flotta_id=1 is index by rowid.

These results are correct, because 99% of the flotta_id column is 0. I cannot use hints, because this sql is generated by a RAD tool. Oracle is 8.1.7.4. Is there any way besides hints to change this behaviour?

Regards,

Hegyvari Krisztian Received on Thu Sep 08 2005 - 06:58:28 CDT

Original text of this message

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