Re: Parallel sec scan in plpgsql

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Parallel sec scan in plpgsql
Дата
Msg-id 20525.1474383497@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Parallel sec scan in plpgsql  (Amit Kapila <amit.kapila16@gmail.com>)
Ответы Re: Parallel sec scan in plpgsql  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Amit Kapila <amit.kapila16@gmail.com> writes:
> On Mon, Sep 19, 2016 at 11:39 PM, Robert Haas <robertmhaas@gmail.com> wrote:
>> However, I think the chances of supporting parallel query for queries
>> not executed to completion any time in the near future are very poor.

> I think here point is that for any case where there is count of rows
> to be selected, we disable parallelism.  There are many genuine cases
> like select count(*) into cnt ... which will run to completion, but as
> plpgsql passes row count to be 1 or 2, it doesn't enter parallel mode.
> There are couple other cases like that.  Do you see a reason for not
> enabling parallelism for such cases?

The other problem that would have to be confronted here is nesting,
ie it would only be OK for a plpgsql function to invoke a parallel
query if it wasn't itself being executed by a parallel worker ---
or maybe even if it's being executed by the leader process but there's
an active Gather somewhere else in the calling query's plan tree.
(Not sure about the implementation's properties for that case.)
We'd have to decide whether we want plancache to track both parallel
and nonparallel plans for plpgsql queries.  Do-able no doubt but
pretty ugly.  Maybe it would be better to fix the rule against workers
invoking their own parallel queries.

However that's probably moot unless the not-executing-to-completion
issue can be solved.
        regards, tom lane



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: [RFC] Should we fix postmaster to avoid slow shutdown?
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Parallel sec scan in plpgsql