Re: [HACKERS] Cached plans and statement generalization

Поиск
Список
Период
Сортировка
Искать
От
Konstantin Knizhnik
Тема
Re: [HACKERS] Cached plans and statement generalization
Дата
Msg-id
58FFB309.5040209@postgrespro.ru
Ответ на
Список
Дерево обсуждения
[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 04/25/2017 07:54 PM, David Fetter wrote:
> On Tue, Apr 25, 2017 at 06:11:09PM +0300, Konstantin Knizhnik wrote:
>> On 24.04.2017 21:43, Andres Freund wrote:
>>> 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. planning in 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.
>> Well, first of all I want to share results I already get: pgbench with
>> default parameters,  scale 10 and one connection:
>>
>> protocol
>> 	TPS
>> simple
>> 	3492
>> extended
>> 	2927
>> prepared
>> 	6865
>> simple + autoprepare
>> 	6844
> If this is string mashing on the unparsed query, as it appears to be,
> it's going to be a perennial source of security issues.

Sorry, may be I missed something, but I can not understand how security can be violated by extracting string literals from query. I am just copying bytes from one buffer to another. I do not try to somehow interpret this parameters.  What I am doing is 
very similar with standard prepared statements.
And moreover query is parsed! Only query which was already parsed and executed (but with different values of parameters) can be autoprepared.


>
> Best,
> David.


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



В списке pgsql-hackers по дате отправления
От: Simon Riggs
Дата:
От: Konstantin Knizhnik
Дата:
FAQ