SQL Performance (MOSC)

MOSC Banner

Using bind variables gives a poor plan compared to using literals

edited Jun 10, 2013 12:36AM in SQL Performance (MOSC) 4 commentsAnswered
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

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center