Re: Built-in connection pooler

Поиск
Список
Период
Сортировка
От Konstantin Knizhnik
Тема Re: Built-in connection pooler
Дата
Msg-id fdbf1761-c904-d987-0d01-1cfc8fca703f@postgrespro.ru
обсуждение исходный текст
Ответ на Re: Built-in connection pooler  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Ответы Re: Built-in connection pooler  (Jaime Casanova <jaime.casanova@2ndquadrant.com>)
Список pgsql-hackers

On 30.07.2019 16:12, Tomas Vondra wrote:
> On Tue, Jul 30, 2019 at 01:01:48PM +0300, Konstantin Knizhnik wrote:
>>
>>
>> On 30.07.2019 4:02, Tomas Vondra wrote:
>>>
>>> My idea (sorry if it wasn't too clear) was that we might handle some
>>> cases more gracefully.
>>>
>>> For example, if we only switch between transactions, we don't quite 
>>> care
>>> about 'SET LOCAL' (but the current patch does set the tainted flag). 
>>> The
>>> same thing applies to GUCs set for a function.
>>> For prepared statements, we might count the number of statements we
>>> prepared and deallocated, and treat it as 'not tained' when there 
>>> are no
>>> statements. Maybe there's some risk I can't think of.
>>>
>>> The same thing applies to temporary tables - if you create and drop a
>>> temporary table, is there a reason to still treat the session as 
>>> tained?
>>>
>>>
>>

I have implemented one more trick reducing number of tainted backends:
now it is possible to use session variables in pooled backends.

How it works?
Proxy determines "SET var=" statements and  converts them to "SET LOCAL 
var=".
Also all such assignments are concatenated and stored in session context 
at proxy.
Then proxy injects this statement inside each transaction block or 
prepend to standalone statements.

This mechanism works only for GUCs set outside transaction.
By default it is switched off. To enable it you should switch on 
"proxying_gucs" parameter.

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


Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Zedstore - compressed in-core columnar storage
Следующее
От: Etsuro Fujita
Дата:
Сообщение: Useless bms_free() calls in build_child_join_rel()