pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Does Postgresql 10 query partitions in parallel?
6+ messages / 4 participants
[nested] [flat]

* Does Postgresql 10 query partitions in parallel?
@ 2017-12-06 13:11 Maltsev Eduard <emaltsev@intellias.com>
  2017-12-06 18:53 ` Re: Does Postgresql 10 query partitions in parallel? John R Pierce <pierce@hogranch.com>
  2017-12-06 20:54 ` Re: Does Postgresql 10 query partitions in parallel? Thomas Kellerer <spam_eater@gmx.net>
  0 siblings, 2 replies; 6+ messages in thread

From: Maltsev Eduard @ 2017-12-06 13:11 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

I'm curious if the new feature of Postgresql allows to take advantage of
multiple cpus on server, and multiple servers (fdw), for larger read only
queries (Data mining). In general there should be some worker that queries
partitions and merges the results, and I expect it to be done in parallel.
This becomes critical when foreign tables are used, I suppose.

Thank you.
Eddie

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Does Postgresql 10 query partitions in parallel?
  2017-12-06 13:11 Does Postgresql 10 query partitions in parallel? Maltsev Eduard <emaltsev@intellias.com>
@ 2017-12-06 18:53 ` John R Pierce <pierce@hogranch.com>
  2017-12-06 19:33   ` Re: Does Postgresql 10 query partitions in parallel? Andres Freund <andres@anarazel.de>
  1 sibling, 1 reply; 6+ messages in thread

From: John R Pierce @ 2017-12-06 18:53 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

On 12/6/2017 5:11 AM, Maltsev Eduard wrote:
> I'm curious if the new feature of Postgresql allows to take advantage 
> of multiple cpus on server, and multiple servers (fdw), for larger 
> read only queries (Data mining). In general there should be some 
> worker that queries partitions and merges the results, and I expect it 
> to be done in parallel. This becomes critical when foreign tables are 
> used, I suppose.


PostgreSQL 10 does indeed have a parallel query feature that will use 
multiple cores.  you have to explicity invoke it.   As this is a first 
implementation, its fairly limited as to the sorts of queries that can 
be parallized, but this will be enhanced in future versions.

https://www.postgresql.org/docs/current/static/parallel-query.html (read 
the whole chapter)


-- 
john r pierce, recycling bits in santa cruz

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Does Postgresql 10 query partitions in parallel?
  2017-12-06 13:11 Does Postgresql 10 query partitions in parallel? Maltsev Eduard <emaltsev@intellias.com>
  2017-12-06 18:53 ` Re: Does Postgresql 10 query partitions in parallel? John R Pierce <pierce@hogranch.com>
@ 2017-12-06 19:33   ` Andres Freund <andres@anarazel.de>
  2017-12-06 19:34     ` Re: Does Postgresql 10 query partitions in parallel? John R Pierce <pierce@hogranch.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Andres Freund @ 2017-12-06 19:33 UTC (permalink / raw)
  To: John R Pierce <pierce@hogranch.com>; +Cc: pgsql-general@lists.postgresql.org

On 2017-12-06 10:53:22 -0800, John R Pierce wrote:
> On 12/6/2017 5:11 AM, Maltsev Eduard wrote:
> > I'm curious if the new feature of Postgresql allows to take advantage of
> > multiple cpus on server, and multiple servers (fdw), for larger read
> > only queries (Data mining). In general there should be some worker that
> > queries partitions and merges the results, and I expect it to be done in
> > parallel. This becomes critical when foreign tables are used, I suppose.
> 
> 
> PostgreSQL 10 does indeed have a parallel query feature that will use
> multiple cores.  you have to explicity invoke it.  

"you have to explicitly invoke it" -  huh?


> As this is a first
> implementation, its fairly limited as to the sorts of queries that can be
> parallized, but this will be enhanced in future versions.

It's already been expanded a lot since 9.6.

Greetings,

Andres Freund




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Does Postgresql 10 query partitions in parallel?
  2017-12-06 13:11 Does Postgresql 10 query partitions in parallel? Maltsev Eduard <emaltsev@intellias.com>
  2017-12-06 18:53 ` Re: Does Postgresql 10 query partitions in parallel? John R Pierce <pierce@hogranch.com>
  2017-12-06 19:33   ` Re: Does Postgresql 10 query partitions in parallel? Andres Freund <andres@anarazel.de>
@ 2017-12-06 19:34     ` John R Pierce <pierce@hogranch.com>
  2017-12-06 20:39       ` Re: Does Postgresql 10 query partitions in parallel? Thomas Kellerer <spam_eater@gmx.net>
  0 siblings, 1 reply; 6+ messages in thread

From: John R Pierce @ 2017-12-06 19:34 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

On 12/6/2017 11:33 AM, Andres Freund wrote:
>> PostgreSQL 10 does indeed have a parallel query feature that will use
>> multiple cores.  you have to explicity invoke it.
> "you have to explicitly invoke it" -  huh?
>
>

oops, I meant, enable.

-- 
john r pierce, recycling bits in santa cruz

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Does Postgresql 10 query partitions in parallel?
  2017-12-06 13:11 Does Postgresql 10 query partitions in parallel? Maltsev Eduard <emaltsev@intellias.com>
  2017-12-06 18:53 ` Re: Does Postgresql 10 query partitions in parallel? John R Pierce <pierce@hogranch.com>
  2017-12-06 19:33   ` Re: Does Postgresql 10 query partitions in parallel? Andres Freund <andres@anarazel.de>
  2017-12-06 19:34     ` Re: Does Postgresql 10 query partitions in parallel? John R Pierce <pierce@hogranch.com>
@ 2017-12-06 20:39       ` Thomas Kellerer <spam_eater@gmx.net>
  0 siblings, 0 replies; 6+ messages in thread

From: Thomas Kellerer @ 2017-12-06 20:39 UTC (permalink / raw)
  To: pgsql-general

John R Pierce schrieb am 06.12.2017 um 20:34:
>>> PostgreSQL 10 does indeed have a parallel query feature that will use
>>> multiple cores.  you have to explicity invoke it.
>> "you have to explicitly invoke it" -  huh?
> 
> oops, I meant, enable.

You are correct for 9.6 where the default was "disabled", but in 10 the default is, that it's enabled:

https://www.postgresql.org/docs/current/static/runtime-config-resource.html#GUC-MAX-PARALLEL-WORKERS...

Sets the maximum number of workers that can be started by a single Gather or Gather Merge node [...] The default value is 2

In 9.6 the default was 0

Thomas










^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Does Postgresql 10 query partitions in parallel?
  2017-12-06 13:11 Does Postgresql 10 query partitions in parallel? Maltsev Eduard <emaltsev@intellias.com>
@ 2017-12-06 20:54 ` Thomas Kellerer <spam_eater@gmx.net>
  1 sibling, 0 replies; 6+ messages in thread

From: Thomas Kellerer @ 2017-12-06 20:54 UTC (permalink / raw)
  To: pgsql-general

Maltsev Eduard schrieb am 06.12.2017 um 14:11:
> I'm curious if the new feature of Postgresql allows to take advantage
> of multiple cpus on server, and multiple servers (fdw), for larger
> read only queries (Data mining). In general there should be some
> worker that queries partitions and merges the results, and I expect
> it to be done in parallel. This becomes critical when foreign tables
> are used, I suppose.

Postgres 9.6 started supporting parallel queries and this has been extended in 10

This has not been "integrated" with the new declarative partitioning.
I think Postgres 11 will support parallel execution based on partitions.

However with foreign tables, a lot of work is pushed to the foreign server (e.g. joins, where clause, aggregation) and whatever gets pushed down to the foreign server might be executed in parallel (subject to the restrictions on parallel query on _that_ server).
I don't think requests to multiple foreign servers are executed in parallel though.

Thomas






^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2017-12-06 20:54 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-12-06 13:11 Does Postgresql 10 query partitions in parallel? Maltsev Eduard <emaltsev@intellias.com>
2017-12-06 18:53 ` John R Pierce <pierce@hogranch.com>
2017-12-06 19:33   ` Andres Freund <andres@anarazel.de>
2017-12-06 19:34     ` John R Pierce <pierce@hogranch.com>
2017-12-06 20:39       ` Thomas Kellerer <spam_eater@gmx.net>
2017-12-06 20:54 ` Thomas Kellerer <spam_eater@gmx.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox