RE: [HACKERS] Cached plans and statement generalization

Поиск
Список
Период
Сортировка
Искать
От
Yamaji, Ryo
Тема
RE: [HACKERS] Cached plans and statement generalization
Дата
Msg-id
9A6E5062D5D4DB458C80C2B2920BD71D5C6B5C@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>
On Tuesday, August 7, 2018 at 0:36 AM, Konstantin Knizhnik wrote: 

> I have registered the patch for next commitfest.
> For some reasons it doesn't find the latest autoprepare-10.patch and still
> refer to autoprepare-6.patch as the latest attachement.

I am sorry for the long delay in my response.
I confirmed it and become reviewer the patch.
I am going to review.


> Right now each prepared statement has two memory contexts: one for raw
> parse tree used as hash table key and another for cached plan itself.
> May be it will be possible to combine them. To calculate memory consumed
> by cached plans, it will be necessary to calculate memory usage statistic
> for all this contexts (which requires traversal of all context's chunks)
> and sum them. It is much more complex and expensive than current check:
> (++autoprepare_cached_plans > autoprepare_limit) although I so not think
> that it will have measurable impact on performance...
> May be there should be some faster way to estimate memory consumed by
> prepared statements.
> 
> So, the current autoprepare_limit allows to limit number of autoprepared
> statements and prevent memory overflow caused by execution of larger
> number of different statements.
> The question is whether we need more precise mechanism which will take
> in account difference between small and large queries. Definitely simple
> query can require 10-100 times less memory than complex query. But memory
> contexts themselves (even with small block size) somehow minimize
> difference in memory footprint of different queries, because of chunked
> allocation.

Thank you for telling me how to implement and its problem.
In many cases when actually designing a system, we estimate the amount of memory
to use and prepare a memory accordingly. Therefore, if we need to estimate memory
usage in both patterns that are limit amount of memory used by prepare queries or
number of prepared statements, I think that there is no problem with the current
implementation.

Apart from the patch, if it can implement an application that outputs estimates of
memory usage when we enter a query, you may be able to use autoprepare more comfortably.
But it sounds difficult..
В списке pgsql-hackers по дате отправления
От: Chris Travers
Дата:
От: Michael Paquier
Дата:
FAQ