Re: Patch: plan invalidation vs stored procedures

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Asko Oja <ascoja(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Joshua Drake <jd(at)commandprompt(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Gregory Stark <stark(at)enterprisedb(dot)com>, Hannu Krosing <hannu(at)2ndquadrant(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Dimitri Fontaine <dfontaine(at)hi-media(dot)com>, pgsql-hackers(at)postgresql(dot)org, David Fetter <david(at)fetter(dot)org>, Martin Pihlak <martin(dot)pihlak(at)gmail(dot)com>
Subject: Re: Patch: plan invalidation vs stored procedures
Date: 2008-08-20 14:18:23
Message-ID: 28763.1219241903@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> This is where the interesting questions are:
> http://archives.postgresql.org/message-id/10333.1219179364%40sss.pgh.pa.us

Upthread, someone speculated about solving the problem by forcing plan
cache flush on *any* catalog change. I think that's probably not
acceptable from an efficiency standpoint. But maybe it'd be a good idea
to special-case common cases and fall back to a stupid flush for less
common cases, rather than invest all the work that'd be needed to track
every direct and indirect dependency of every plan. My first thought
along these lines is:

* track table dependencies exactly (important for efficiency, plus we've
got the code already)

* track function dependencies exactly (seems function definitions might
change often enough to make it important for efficiency; maybe only
track PL function dependencies??)

* brute-force flush for any other catalog change that could affect plans

However I have no hard evidence to back up drawing the line there rather
than somewhere else. Anyone have data on what sort of DDL changes are
common in their applications?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-08-20 14:23:20 Re: Volatile functions in subqueries don't prevent subqueries from being evaluated in initplans?
Previous Message Alvaro Herrera 2008-08-20 14:15:36 make dist does not work in VPATH