Re: [HACKERS] Cached plans and statement generalization - Mailing list pgsql-hackers

From Andres Freund
Subject Re: [HACKERS] Cached plans and statement generalization
Date
Msg-id 20170424184353.u2krt2eiw2l6e2af@alap3.anarazel.de
Whole thread Raw
In response to [HACKERS] Cached plans and statement generalization  (Konstantin Knizhnik <k.knizhnik@postgrespro.ru>)
Responses Re: [HACKERS] Cached plans and statement generalization  (Konstantin Knizhnik <k.knizhnik@postgrespro.ru>)
List pgsql-hackers
Hi,

On 2017-04-24 11:46:02 +0300, Konstantin Knizhnik wrote:
> So what I am thinking now is implicit query caching. If the same query with
> different literal values is repeated many times, then we can try to
> generalize this query and replace it with prepared query with
> parameters.

That's not actuall all that easy:
- You pretty much do parse analysis to be able to do an accurate match. How much overhead is parse analysis vs.
planningin your cases?
 
- The invalidation infrastructure for this, if not tied to to fully parse-analyzed statements, is going to be hell.
- Migrating to parameters can actually cause significant slowdowns, not nice if that happens implicitly.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] OK, so culicidae is *still* broken
Next
From: Andres Freund
Date:
Subject: Re: [HACKERS] OK, so culicidae is *still* broken