Re: Plan invalidation vs. unnamed prepared statements - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: Plan invalidation vs. unnamed prepared statements
Date
Msg-id 87fy8i9rkv.fsf@stark.xeocode.com
Whole thread Raw
In response to Plan invalidation vs. unnamed prepared statements  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Plan invalidation vs. unnamed prepared statements  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
"Tom Lane" <tgl@sss.pgh.pa.us> writes:

> B. Don't store the unnamed statement in the plan cache.  To make sure
> it's not used anymore when the plan might be stale, forcibly discard
> the unnamed statement after execution.  This would get rid of a lot
> of overhead but would mean a significant change in the protocol-level
> behavior.  It's hard to guess how many clients might be broken by it
> --- conceivably not any, but that seems too optimistic :-(

Can we forcibly discard it if *any* messages are received that might
invalidate a plan? So basically it would work fine unless anyone in the system
does any DDL at all? I guess that has the downside of introducing random
unpredictable failures.

Or stash the query string and replan it (possibly in the query cache this
time) if someone executes it a second time?

Can't say I like either of those options much, just trying to brainstorm.

--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: PostgreSQL - 'SKYLINE OF' clause added!
Next
From: Jeff Davis
Date:
Subject: Re: Bug: Buffer cache is not scan resistant