Re: Rule recompilation - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Rule recompilation
Date
Msg-id 11614.994964142@sss.pgh.pa.us
Whole thread Raw
In response to Re: Rule recompilation  (Jan Wieck <JanWieck@Yahoo.com>)
Responses Re: Rule recompilation
List pgsql-hackers
Jan Wieck <JanWieck@Yahoo.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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Rule recompilation
Next
From: Tom Lane
Date:
Subject: Re: Rule recompilation