Using bind variables gives a poor plan compared to using literals
11.2.0.2
Hi,
I have this rather simple SQL:
SELECT SUM(quantity)FROM dat_prepackWHERE order_no = :b3AND style = :b2AND color = NVL(:b1, color);When checking the explain plan using bind variales I get a poor one, but when using this:
SELECT SUM(quantity)FROM dat_prepackWHERE order_no = 679526AND style = 6890915AND color = NVL(300, color);I get a good one.Any ideas where to start?RegardsS
0