RE: Select statement runs slow until flush of shared pool

From: Jorgensen, Finn <>
Date: Thu, 29 Nov 2012 17:01:11 -0500
Message-ID: <9CE162BC5ED2C643956B526A7EDE46FF0359446C911B_at_EXM-OMF-04.Ceg.Corp.Net>

Thanks to everybody who responded.
I still don't know which of the SQL statements changed execution plan but rather than doing lengthy troubleshooting and aggravation for the client I chose to generate stored outlines for all 8 SQL statements executed by the stored functions while the plans were good. By pinning the good plan to the statement the hope is that the problem doesn't return.

Thanks again.


From: Carlos Sierra [] Sent: Wednesday, November 28, 2012 6:30 AM To:
Cc: Jorgensen, Finn; Tanel Poder; oracle Freelists ( Subject: Re: Select statement runs slow until flush of shared pool

Clarification here. The main SQL cannot change its execution plan while it is execution. That is given. But this SQL executes recursively two functions that contain some SQL statement. Those SQL statements get executed many times and they can be invalidated and re-parsed while the parent SQL is still in execution.

On Tue, Nov 27, 2012 at 4:25 PM, Radoulov, Dimitre <<>> wrote: On 27/11/2012 20:48, Jorgensen, Finn wrote:
> [...]
> I've had a couple of people suggest maybe the statement was running with a bad plan and thus it was slow. However, the slow running statements are fixed more or less immediately by a flush of the shared pool. What I'm trying to explain is that "currently running" SQL is fixed by the flush. The execution plan doesn't change once the statement is running. That's why I went down the path of latches etc.
As I already said, we had a very similar issue, flushing the shared pool seemed to affect the plan immediately.
I don't know if the plan of the SQL invoked by the function is guaranteed to remain the same during execution.



Cheers -- Carlos Sierra

>>> This e-mail and any attachments are confidential, may contain legal, professional or other privileged information, and are intended solely for the addressee.  If you are not the intended recipient, do not use the information in this e-mail in any way, delete this e-mail and notify the sender. -IP1

Received on Thu Nov 29 2012 - 23:01:11 CET

Original text of this message