Re: Parallel Queries and PostGIS - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: Parallel Queries and PostGIS
Date
Msg-id 20160422184435.GD10850@tamriel.snowman.net
Whole thread Raw
In response to Re: Parallel Queries and PostGIS  (Paul Ramsey <pramsey@cleverelephant.ca>)
Responses Re: Parallel Queries and PostGIS  (Paul Ramsey <pramsey@cleverelephant.ca>)
List pgsql-hackers
Paul,

* Paul Ramsey (pramsey@cleverelephant.ca) wrote:
> On Mon, Mar 28, 2016 at 9:45 AM, Stephen Frost <sfrost@snowman.net> wrote:
> > Would you agree that it'd be helpful to have for making the st_union()
> > work better in parallel?
>
> For our particular situation w/ ST_Union, yes, it would be ideal to be
> able to run a worker-side combine function as well as the master-side
> one. Although the cascaded union would be less effective spread out
> over N nodes, doing it only once per worker, rather than every N
> records would minimize the loss of effectiveness.

I chatted with Robert a bit about this and he had an interesting
suggestion.  I'm not sure that it would work for you, but the
serialize/deserialize functions are used to transfer the results from
the worker process to the main process.  You could possibly do the
per-worker finalize work in the serialize function to get the benefit of
running that in parallel.

You'll need to mark the aggtranstype as 'internal' to have the
serialize/deserialize code called.  Hopefully that's not too much of an
issue.

Thanks!

Stephen

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: EXPLAIN VERBOSE with parallel Aggregate
Next
From: Robert Haas
Date:
Subject: Re: GIN data corruption bug(s) in 9.6devel