Function query plan

Started by Paul Mackayalmost 20 years ago4 messagesgeneral
Jump to latest
#1Paul Mackay
mackaypaul@gmail.com

I understand that the query plan of a function is determined at CREATION and
remains the same whatever the parameter(s) value. I suppose then that this
plan is stored somewhere in a system table ? Is it possible to consult this
plan ?

Thanks,
Paul

#2Doug McNaught
doug@mcnaught.org
In reply to: Paul Mackay (#1)
Re: Function query plan

"Paul Mackay" <mackaypaul@gmail.com> writes:

I understand that the query plan of a function is determined at
CREATION and remains the same whatever the parameter(s) value. I
suppose then that this plan is stored somewhere in a system table ?

You are misinformed. It's determined the first time that function is
executed in a given backend, and stored in backend-local memory.
There's no way that I know of to look at it.

-Doug

#3Dany De Bontridder
dany@alchimerys.be
In reply to: Doug McNaught (#2)
Re: Function query plan

On Friday 05 May 2006 13:06, Douglas McNaught wrote:

"Paul Mackay" <mackaypaul@gmail.com> writes:

I understand that the query plan of a function is determined at
CREATION and remains the same whatever the parameter(s) value. I
suppose then that this plan is stored somewhere in a system table ?

You are misinformed. It's determined the first time that function is
executed in a given backend, and stored in backend-local memory.
There's no way that I know of to look at it.

And after a vacuum analyze, the plan can change ??

D.

#4Doug McNaught
doug@mcnaught.org
In reply to: Dany De Bontridder (#3)
Re: Function query plan

Dany De Bontridder <dany@alchimerys.be> writes:

And after a vacuum analyze, the plan can change ??

I don't *think* that the pl/pgsql query plan cache is ever currently
flushed in the lifetime of a given connection. If you disconnect and
reconnect with a fresh backend it will be planned again the next time
you call the function.

-Doug