Re: How to estimate the shared memory size required for parallel scan?

From: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
To: Masayuki Takahashi <masayuki038(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: How to estimate the shared memory size required for parallel scan?
Date: 2018-08-18 14:07:54
Message-ID: CAEepm=1_hnxj8L3+fH6_BrU8F19A6Q9MyV5pRG1BX18aW6GGGw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Aug 19, 2018 at 1:40 AM, Thomas Munro
<thomas(dot)munro(at)enterprisedb(dot)com> wrote:
> A true parallel scan of an FDW would be one where each process emits
> an arbitrary fraction of the tuples, but together they emit all of the
> tuples. You'd almost certainly need to use some shared memory to
> coordinate that. To say that you support that, I think your
> GetForeignPaths() function would need to call add_partial_path(). And
> unless I'm mistaken, whether or not InitializeDSMForeignScan etc are
> called might be the only indication you get of whether you need to run
> in parallel-aware mode. I haven't personally heard of any FDWs that
> can do this yet, but I just tried hacking file_fdw to register a
> partial path and it seems to work (though of course the results are
> duplicated because the emitted tuples are not actually partial).

... though I just noticed that my quick test used "Single Copy" mode.
I think I see why: it looks like core's create_foreignscan_path()
function might need to take num_workers and set parallel_aware if > 0.
So I guess this hasn't been done before and would require some more
research.

--
Thomas Munro
http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2018-08-18 15:23:10 Re: TupleTableSlot abstraction
Previous Message Thomas Munro 2018-08-18 13:40:05 Re: How to estimate the shared memory size required for parallel scan?