Re: [HACKERS] PATCH: enabling parallel execution for cursorsexplicitly (experimental)

Поиск
Список
Период
Сортировка
От Tomas Vondra
Тема Re: [HACKERS] PATCH: enabling parallel execution for cursorsexplicitly (experimental)
Дата
Msg-id 730bc564-54d9-9249-8bb3-b4fb72bb167a@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: [HACKERS] PATCH: enabling parallel execution for cursorsexplicitly (experimental)  (Amit Kapila <amit.kapila16@gmail.com>)
Список pgsql-hackers

On 10/16/2017 01:13 PM, Amit Kapila wrote:
> On Sat, Oct 14, 2017 at 11:44 PM, Tomas Vondra
> <tomas.vondra@2ndquadrant.com> wrote:
>> Hi,
>>
>>
>> I propose is to add a new cursor option (PARALLEL), which would allow
>> parallel plans for that particular user-defined cursor. Attached is an
>> experimental patch doing this (I'm sure there are some loose ends).
>>
> 
> How will this work for backward scans?
> 

It may not work, just like for regular cursors without SCROLL. And if
you specify SCROLL, then I believe a Materialize node will be added
automatically if needed, but haven't tried.

> 
>>
>> Regarding (2), if the user suspends the cursor for a long time, bummer.
>> The parallel workers will remain assigned, doing nothing. I don't have
>> any idea how to get around that, but I don't see how we could do better.
>>
> 
> One idea could be that whenever someone uses Parallel option, we can 
> fetch and store all the data locally before returning control to the 
> user (something like WITH HOLD option).
> 

I don't like that very much, as it adds unnecessary overhead. As I said
before, I'm particularly interested in cursors returning large amounts
of data, so the overhead may be quite significant.

regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


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

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

Предыдущее
От: Eric Radman
Дата:
Сообщение: [HACKERS] [PATCH] Add recovery_min_apply_delay_reconnect recovery option
Следующее
От: Robert Haas
Дата:
Сообщение: Re: [HACKERS] Extended statistics is not working on Vars hidden undera RelabelType