Re: cpu-intensive immutable function and parallel scan

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: cpu-intensive immutable function and parallel scan
Дата
Msg-id 1713127.1624368568@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: cpu-intensive immutable function and parallel scan  (David Rowley <dgrowleyml@gmail.com>)
Список pgsql-general
David Rowley <dgrowleyml@gmail.com> writes:
> On Tue, 22 Jun 2021 at 19:06, Niels Jespersen <NJN@dst.dk> wrote:
>> I think I could achieve some speedup by parallelizing further, distributing the cpu-work among additional workers.
But,how do I achive that best? 

> You'll want to ensure max_parallel_workers_per_gather is set high
> enough and you have max_parallel_workers set to something high enough.
> You can then do:
> alter table t1 set (parallel_workers = <number of workers>);

Also, if you don't have a fairly high COST value set on the function,
try raising that to make the planner understand that it's expensive.
My recollection is that the amount of parallelism it goes for is partly
predicated on the estimated query cost.

            regards, tom lane



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

Предыдущее
От: Vijaykumar Jain
Дата:
Сообщение: Re: second CTE kills perf
Следующее
От: Tom Lane
Дата:
Сообщение: Re: second CTE kills perf