Re: Select statement runs slow until flush of shared pool

From: Carlos Sierra <>
Date: Wed, 28 Nov 2012 06:30:19 -0500
Message-ID: <>

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.
> Regards
> Dimitre
> --

Cheers -- Carlos Sierra

Received on Wed Nov 28 2012 - 12:30:19 CET

Original text of this message