pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
To: Tsunakawa, Takayuki <tsunakawa.takay@jp.fujitsu.com>
To: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: Cached plans and statement generalization
Date: Wed, 26 Apr 2017 10:49:18 +0300
Message-ID: <bda56ce2-64fa-8236-b3a9-71db71b41c6b@postgrespro.ru> (raw)
In-Reply-To: <0A3221C70F24FB45833433255569204D1F6EB258@G01JPEXMBYT05>
References: <8e76d8fc-8b8c-14bd-d4d1-e9cf193a74f5@postgrespro.ru>
	<20170424184353.u2krt2eiw2l6e2af@alap3.anarazel.de>
	<f0bfcdd6-dba3-e9a8-2108-146e1f880839@postgrespro.ru>
	<0A3221C70F24FB45833433255569204D1F6EB258@G01JPEXMBYT05>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>



On 26.04.2017 04:00, Tsunakawa, Takayuki wrote:
> From: pgsql-hackers-owner@postgresql.org
>> [mailto:pgsql-hackers-owner@postgresql.org] On Behalf Of Konstantin
>> Knizhnik
>> Well, first of all I want to share results I already get: pgbench with default
>> parameters,  scale 10 and one connection:
>>
>> So autoprepare is as efficient as explicit prepare and can increase
>> performance almost two times.
> This sounds great.
>
> BTW, when are the autoprepared statements destroyed?
Right now them are destroyed only in case of receiving invalidation  
message (when catalog is changed).
Prepared statements are local to backend and are located in backend's  
memory.
It is unlikely, that there will be too much different queries which  
cause memory overflow.
But in theory such situation is certainly possible.


>   Are you considering some upper limit on the number of prepared statements?
In this case we need some kind of LRU for maintaining cache of  
autoprepared statements.
I think that it is good idea to have such limited cached - it can avoid  
memory overflow problem.
I will try to implement it.


> Regards
> Takayuki Tsunakawa
>
>

-- 
Konstantin Knizhnik
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company



-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (107+ messages)  latest in thread

Message-ID: <bda56ce2-64fa-8236-b3a9-71db71b41c6b@postgrespro.ru>
Permalink:  ../bda56ce2-64fa-8236-b3a9-71db71b41c6b@postgrespro.ru/
Also on:    postgresql.org/message-id/bda56ce2-64fa-8236-b3a9-71db71b41c6b@postgrespro.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: k.knizhnik@postgrespro.ru, tsunakawa.takay@jp.fujitsu.com
  Subject: Re: Cached plans and statement generalization
  In-Reply-To: <bda56ce2-64fa-8236-b3a9-71db71b41c6b@postgrespro.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox