Re: DISCARD ALL ; stored procedures

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: DISCARD ALL ; stored procedures
Date: 2011-01-08 21:28:13
Message-ID: 20110108212813.GY4933@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-01-08 21:59:11 contrib/intarray (was Re: Fixing GIN for empty/null/full-scan cases)
Previous Message Joel Jacobson 2011-01-08 21:21:53 Re: obj_unique_identifier(oid)