Re: Parallel Queries and PostGIS

From: Paul Ramsey <pramsey(at)cleverelephant(dot)ca>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Parallel Queries and PostGIS
Date: 2016-04-26 19:17:27
Message-ID: CACowWR2udiaOq7Bna4BnPURu+1BTLdt-BZc0iXWVz0MMgnSBsQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Apr 22, 2016 at 11:44 AM, Stephen Frost <sfrost(at)snowman(dot)net> wrote:
> Paul,
>
> * Paul Ramsey (pramsey(at)cleverelephant(dot)ca) wrote:
>> On Mon, Mar 28, 2016 at 9:45 AM, Stephen Frost <sfrost(at)snowman(dot)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. We were actually thinking that it might make more
sense to just do the parallel processing in our own threads in the
finalfunc. Not as elegant and magical as bolting into the PgSQL infra,
but if we're doing something hacky anyways, might as well be our own
hacky.

ATB,
P

>
> Thanks!
>
> Stephen

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2016-04-26 20:22:49 Re: Timeline following for logical slots
Previous Message Merlin Moncure 2016-04-26 18:25:54 Re: Add jsonb_compact(...) for whitespace-free jsonb to text