Re: read-only planner input - Mailing list pgsql-hackers

From Neil Conway
Subject Re: read-only planner input
Date
Msg-id 423AADDC.9040607@samurai.com
Whole thread Raw
In response to Re: read-only planner input  (Oliver Jowett <oliver@opencloud.com>)
Responses Re: read-only planner input
List pgsql-hackers
Oliver Jowett wrote:
> What happens if (for example) DateStyle changes between the two parses? 
From my original email:

This is the common case of a more general problem: a query plan depends
on various parts of the environment at plan-creation time. That
environment includes the definitions of database objects, but also GUC
variables (most importantly search_path, but also optimizer-tuning
variables for example), the state of database statistics, and so on.
I'll leave resolution of the more general problem to someone else -- I
think if we can manage to invalidate plans automatically when dependent
objects change, that's better than nothing.

I'm don't think recreating the plan from the query string changes this 
fundamentally -- the interaction between (for example) GUC variables and 
prepared plans will likely not be well-defined (which will be no worse 
than it is today).

(It might be plausible to work something out where a backend-local SET 
of some subset of the GUC variables flushes all the cached query plans, 
but I'm don't have any plans to look at it myself.)

-Neil


pgsql-hackers by date:

Previous
From: Shachar Shemesh
Date:
Subject: Unstable timestamp binary representation?
Next
From: Shachar Shemesh
Date:
Subject: Version 1.0.0.18 of OLE DB released