Re: Parallel query only when EXPLAIN ANALYZEd

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: Parallel query only when EXPLAIN ANALYZEd
Дата
Msg-id CAKJS1f9GzQ1QJj7kyQq8N7W39aV7fjySsKEn0FBJzHtMDZLqeQ@mail.gmail.com
обсуждение исходный текст
Ответ на Parallel query only when EXPLAIN ANALYZEd  (Jay Knight <jay@jayknight.com>)
Ответы Re: Parallel query only when EXPLAIN ANALYZEd  (Jay Knight <jay@jayknight.com>)
Список pgsql-general
On 30 September 2016 at 08:52, Jay Knight <jay@jayknight.com> wrote:
> So, why might postgres parallelize the query when I explain analyze it, but
> not when I just run it by itself?

One theory would be that, the worker might not have been available
when you performed the query execution, but it just happened to be
when you did the EXPLAIN ANALYZE. If the executor can't get a free
worker process, then it'll just do all the work in the main process.
The plan parallel plan that you've shown, given no extra worker
processes, would most likely perform the same as the serial plan you
showed, since the extra Finalize Aggregate node is only handling 1 row
anyway.

What's max_worker_processes set to?

If this is just a test machine, you should be able to see what's going
on if you install auto_explain, and enable auto_explain.log_analyze
(https://www.postgresql.org/docs/current/static/auto-explain.html)
Setting this up will log the EXPLAIN ANALYZE to the PostgreSQL logs
when you execute the query as normal.


--
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


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

Предыдущее
От: Venkata B Nagothi
Дата:
Сообщение: Re: Multi tenancy : schema vs databases
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: [HACKERS] pg_upgrade from 9.5 to 9.6 fails with "invalid argument"