Re: Rule recompilation

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jan Wieck <JanWieck(at)Yahoo(dot)com>
Cc: "Mikheev, Vadim" <vmikheev(at)SECTORBASE(dot)COM>, PostgreSQL HACKERS <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Rule recompilation
Date: 2001-07-12 18:55:42
Message-ID: 11614.994964142@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jan Wieck <JanWieck(at)Yahoo(dot)com> writes:
> And PL/pgSQL? We don't prepare all the statements into SPI
> plans at compile time. We wait until the separate branches
> are needed, so how do you know offhand here?

If we haven't prepared a statement yet, then we don't need to reprepare
it, hmm? So it'd be sufficient to keep track of a list of all objects
referenced *so far* by each plpgsql function.

Your complaints about pltcl and plperl are irrelevant because they don't
save prepared plans. For the languages that do save prepared plans, it
seems possible to keep track of a list of all objects that each plan
depends on. So I think that we should try to do it right, rather than
assuming from the start that we can't.

> In the PL/pgSQL case it *might* be possible. But is it worth
> it?

Yes. If we're not going to do it right, I think we needn't bother to do
it at all. "Restart your backend" is just as good an answer, probably
better, than "issue a RECOMPILE against everything affected by whatever
you changed". If the system can't keep track of that, how likely is it
that the user can?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 2001-07-12 19:00:44 Re: Rule recompilation
Previous Message Tom Lane 2001-07-12 18:50:38 Re: Rule recompilation