Обсуждение: Function query plan
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
Thanks,
Paul
"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
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.
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