Thread: [PERFORM] Can postgresql plan a query using multiple CPU cores?

[PERFORM] Can postgresql plan a query using multiple CPU cores?

From
Clemens Eisserer
Date:
Hi,

I have a letancy-sensitive legacy application, where the time consumed
by query planning was always causing some headaches.
Currently it is running on postgresql-8.4 - will postgresql-10 support
generating plans using multiple CPU cores to reduce the time required
to generate a single plan?

Thank you in advance and best regards, Clemens


Re: [PERFORM] Can postgresql plan a query using multiple CPU cores?

From
"David G. Johnston"
Date:
On Monday, May 22, 2017, Clemens Eisserer <linuxhippy@gmail.com> wrote:
Hi,

I have a letancy-sensitive legacy application, where the time consumed
by query planning was always causing some headaches.
Currently it is running on postgresql-8.4 - will postgresql-10 support
generating plans using multiple CPU cores to reduce the time required
to generate a single plan?


My understanding, from both list monitoring and the release notes, is that query parallelization happens only during execution, not planning.  A single process is still responsible for evaluating all (possibly partial) plans and picking the best one - flagging those plan steps that can leverage parallelism for possible execution.

David J.
 

Re: [PERFORM] Can postgresql plan a query using multiple CPU cores?

From
Mark Kirkwood
Date:
On 23/05/17 08:21, Clemens Eisserer wrote:
> Hi,
>
> I have a letancy-sensitive legacy application, where the time consumed
> by query planning was always causing some headaches.
> Currently it is running on postgresql-8.4 - will postgresql-10 support
> generating plans using multiple CPU cores to reduce the time required
> to generate a single plan?
>
> Thank you in advance and best regards, Clemens
>
>
Hi,

Might be worthwhile posting an example (query + EXPLAIN ANALYZE etc), so
we can see what type of queries are resulting in long plan times.

Cheers

Mark



Re: [PERFORM] Can postgresql plan a query using multiple CPU cores?

From
Pavel Stehule
Date:
Hi

2017-05-22 22:21 GMT+02:00 Clemens Eisserer <linuxhippy@gmail.com>:
Hi,

I have a letancy-sensitive legacy application, where the time consumed
by query planning was always causing some headaches.
Currently it is running on postgresql-8.4 - will postgresql-10 support
generating plans using multiple CPU cores to reduce the time required
to generate a single plan?

 no. PostgreSQL 9.6 and higher uses more CPU only for execution.

For planner speed are important GUC parameters join_collapse_limit, from_collapse_limit and show geqo_threshold.

You can try to decrease geqo_threshold - with low geqo_threshold you can increase join_collapse_limit and from_collapse_limit

Regards

Pavel

Thank you in advance and best regards, Clemens


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