Re: DISCARD ALL ; stored procedures - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: DISCARD ALL ; stored procedures
Date
Msg-id 20110108212813.GY4933@tamriel.snowman.net
Whole thread Raw
In response to Re: DISCARD ALL ; stored procedures  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: DISCARD ALL ; stored procedures  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
All,

Alright, so, the whole fn_extra stuff seems to be unrelated..  I'm not
sure when it's used (perhaps multiple calls to the same function in a
given query?), but the PLs have their own hash tables that they use for
storing functions that have been called.  I had assumed that was done
through fmgr, but apparently not (or at least, I can't find where..).
I'm starting to wonder if we're trying to do too much with this
though.  If all the PLs have to go through SPI to *get* plans (at least
ones we care about), perhaps we could just use SPI to implement the
plan invalidation?

Consider if we saved the DISCARD's transaction ID and store the
last-discard txn (or whenever the function was first prepared) in the
result of the SPI prepare and then detect if we need to switch to
replanning the query in SPI_execute_plan instead of just executing it.
Of course, we'd have to have enough info *to* replan it, but we should
be able to manage that.

Thoughts?
Stephen

pgsql-hackers by date:

Previous
From: Joel Jacobson
Date:
Subject: Re: obj_unique_identifier(oid)
Next
From: Tom Lane
Date:
Subject: contrib/intarray (was Re: Fixing GIN for empty/null/full-scan cases)