Re: In what circumstances might optimizer not choose the lowest cost?

From: Stefan Koehler <>
Date: Tue, 20 Jan 2015 18:55:25 +0100 (CET)
Message-ID: <>

Hi Kim,
just out of curiosity. What do you mean with "this old old ERP application environment parses SQL before populating bind variables"? Do you differ between parsing and optimization or do you merge and name both activities as parsing in general?

The cursor life cycle is usually something like that: open cursor - parse cursor - (define output variable) - (bind input variables) - execute cursor - etc.

As you can see the binds are populated after "parsing" - e.g. demo examples with DBMS_SQL:

.. or does your app use such an old client that does not support deferred optimization?


Best Regards
Stefan Koehler

Freelance Oracle performance consultant and researcher Homepage:
Twitter: _at_OracleSK

> Kim Berg Hansen <> hat am 20. Januar 2015 um 15:20 geschrieben:
> Unpeeked bind might be something to look into. Unfortunately this old old ERP application environment parses SQL before populating bind variables,
> so I haven't much help from bind variable peeking. Although that doc is an old bug that should be fixed in version 10.2 (and we're running
>, I can't rule out that this may be involved.
> It does appear that the unpeeked bind variable is involved here. I did a trial with bind variables in SQL*Plus that I've set before the parsing/call
> of the queries - that worked nicely no matter if my check constraint is in place or not.
> As unfortunately I cannot help that my production environment isn't really using bind variable peeking

Received on Tue Jan 20 2015 - 18:55:25 CET

Original text of this message