RE: [HACKERS] Cached plans and statement generalization

Поиск
Список
Период
Сортировка
Искать
От
Yamaji, Ryo
Тема
RE: [HACKERS] Cached plans and statement generalization
Дата
Msg-id
9A6E5062D5D4DB458C80C2B2920BD71D5C2FA8@g01jpexmbkw23
Ответ на
Список
Дерево обсуждения
[HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization Andres Freund <andres@anarazel.de>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization "Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization Pavel Stehule <pavel.stehule@gmail.com>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization Bruce Momjian <bruce@momjian.us>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization Bruce Momjian <bruce@momjian.us>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization Bruce Momjian <bruce@momjian.us>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization Bruce Momjian <bruce@momjian.us>
Re: [HACKERS] Cached plans and statement generalization Andres Freund <andres@anarazel.de>
Re: [HACKERS] Cached plans and statement generalization Douglas Doole <dougdoole@gmail.com>
Re: [HACKERS] Cached plans and statement generalization Bruce Momjian <bruce@momjian.us>
Re: [HACKERS] Cached plans and statement generalization Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization Andres Freund <andres@anarazel.de>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization Andres Freund <andres@anarazel.de>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization Thomas Munro <thomas.munro@enterprisedb.com>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization Michael Paquier <michael.paquier@gmail.com>
RE: [HACKERS] Cached plans and statement generalization "Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>
Re: [HACKERS] Cached plans and statement generalization Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization Stephen Frost <sfrost@snowman.net>
Re: [HACKERS] Cached plans and statement generalization Thomas Munro <thomas.munro@enterprisedb.com>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
RE: [HACKERS] Cached plans and statement generalization "Yamaji, Ryo" <yamaji.ryo@jp.fujitsu.com>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
RE: [HACKERS] Cached plans and statement generalization "Yamaji, Ryo" <yamaji.ryo@jp.fujitsu.com>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
RE: [HACKERS] Cached plans and statement generalization "Yamaji, Ryo" <yamaji.ryo@jp.fujitsu.com>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
RE: [HACKERS] Cached plans and statement generalization "Yamaji, Ryo" <yamaji.ryo@jp.fujitsu.com>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
RE: [HACKERS] Cached plans and statement generalization "Yamaji, Ryo" <yamaji.ryo@jp.fujitsu.com>
Re: [HACKERS] Cached plans and statement generalization Dmitry Dolgov <9erthalion6@gmail.com>
RE: [HACKERS] Cached plans and statement generalization "Yamaji, Ryo" <yamaji.ryo@jp.fujitsu.com>
Re: [HACKERS] Cached plans and statement generalization Dmitry Dolgov <9erthalion6@gmail.com>
RE: [HACKERS] Cached plans and statement generalization "Nagaura, Ryohei" <nagaura.ryohei@jp.fujitsu.com>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
RE: [HACKERS] Cached plans and statement generalization "Yamaji, Ryo" <yamaji.ryo@jp.fujitsu.com>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization Thomas Munro <thomas.munro@gmail.com>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization Thomas Munro <thomas.munro@gmail.com>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization Thomas Munro <thomas.munro@gmail.com>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization Heikki Linnakangas <hlinnaka@iki.fi>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization Daniel Migowski <dmigowski@ikoffice.de>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization Daniel Migowski <dmigowski@ikoffice.de>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization Alvaro Herrera <alvherre@2ndquadrant.com>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization Michael Paquier <michael@paquier.xyz>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] Cached plans and statement generalization Daniel Gustafsson <daniel@yesql.se>
Re: [HACKERS] Cached plans and statement generalization Юрий Соколов <funny.falcon@gmail.com>
RE: [HACKERS] Cached plans and statement generalization "Nagaura, Ryohei" <nagaura.ryohei@jp.fujitsu.com>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: Re: [HACKERS] Cached plans and statement generalization David Steele <david@pgmasters.net>
Re: Re: Re: [HACKERS] Cached plans and statement generalization David Steele <david@pgmasters.net>
Re: [HACKERS] Cached plans and statement generalization Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization Andres Freund <andres@anarazel.de>
Re: [HACKERS] Cached plans and statement generalization David Fetter <david@fetter.org>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization David Fetter <david@fetter.org>
Re: [HACKERS] Cached plans and statement generalization "David G. Johnston" <david.g.johnston@gmail.com>
Re: [HACKERS] Cached plans and statement generalization Serge Rielau <serge@rielau.com>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization Serge Rielau <serge@rielau.com>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization Serge Rielau <serge@rielau.com>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization Doug Doole <ddoole@salesforce.com>
Re: [HACKERS] Cached plans and statement generalization Andres Freund <andres@anarazel.de>
Re: [HACKERS] Cached plans and statement generalization Doug Doole <ddoole@salesforce.com>
Re: [HACKERS] Cached plans and statement generalization Andres Freund <andres@anarazel.de>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization "Finnerty, Jim" <jfinnert@amazon.com>
Re: [HACKERS] Cached plans and statement generalization Doug Doole <ddoole@salesforce.com>
Re: [HACKERS] Cached plans and statement generalization Serge Rielau <serge@rielau.com>
Re: [HACKERS] Cached plans and statement generalization Doug Doole <ddoole@salesforce.com>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: [HACKERS] Cached plans and statement generalization Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
> -----Original Message-----
> From: Konstantin Knizhnik [mailto:k.knizhnik@postgrespro.ru]
> Sent: Friday, January 12, 2018 9:53 PM
> To: Thomas Munro ; Stephen Frost
> 
> Cc: Michael Paquier ; PostgreSQL mailing
> lists ; Tsunakawa, Takayuki/綱川 貴之
> 
> Subject: Re: [HACKERS] Cached plans and statement generalization
>
> Thank you very much for reporting the problem.
> Rebased version of the patch is attached.

Hi Konstantin.

I think that this patch excel very much. Because the customer of our
company has the demand that migrates from other DB to PostgreSQL, and
the problem to have to modify the application program to do prepare in
that case occurs. It is possible to solve it by the problem's using this
patch. I want to be helping this patch to be committed. Will you participate
in the following CF? 

To review this patch, I verified it. The verified environment is
PostgreSQL 11beta2. It is necessary to add "executor/spi.h" and "jit/jit.h"
to postgres.c of the patch by the updating of PostgreSQL. Please rebase.

1. I confirmed the influence on the performance by having applied this patch.
The result showed the tendency similar to Konstantin.
-s:100	-c:8	-t: 10000	read-only
simple:					20251 TPS
prepare:				29502 TPS
simple(autoprepare):			28001 TPS

2. I confirmed the influence on the memory utilization by the length of query that did
autoprepare. Short queries have 1 constant. Long queries have 100 constants.
This result was shown that preparing long query used the memory more.
before prepare:plan cache context: 1032 used
prepare 10 short query statement:plan cache context: 15664 used
prepare 10 long query statement:plan cache context: 558032 used

In this patch, the maximum number of query that can do prepare can be set to autoprepare_limit.
However, is it good in this? I think that I can assume the scene in the following.
- Application side user: To elicit the performance, they want to specify the number of prepared
query.
- Operation side user: To prevent the memory from overflowing, they want to set the maximum value
of the memory utilization.
Therefore, I propose to add the parameter to specify the maximum memory utilization.

3. I confirmed the transition of the amount of the memory when it tried to prepare query
of the number that exceeded the value specified for autoprepare_limit.
[autoprepare_limit=1 and execute 10 different queries]
	plan cache context: 1032 used
	plan cache context: 39832 used
	plan cache context: 78552 used
	plan cache context: 117272 used
	plan cache context: 155952 used
	plan cache context: 194632 used
	plan cache context: 233312 used
	plan cache context: 272032 used
	plan cache context: 310712 used
	plan cache context: 349392 used
	plan cache context: 388072 used

I feel the doubt in an increase of the memory utilization when I execute a lot of
query though cached query is one (autoprepare_limit=1).
This behavior is correct?

Best regards, Yamaji
В списке pgsql-hackers по дате отправления
От: Kyotaro HORIGUCHI
Дата:
От: Kyotaro HORIGUCHI
Дата:
Сообщение: Documentaion fix.
FAQ