Re: Parallel Seq Scan

From: Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, Kouhei Kaigai <kaigai(at)ak(dot)jp(dot)nec(dot)com>, Amit Langote <amitlangote09(at)gmail(dot)com>, Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, Fabrízio Mello <fabriziomello(at)gmail(dot)com>, Thom Brown <thom(at)linux(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Parallel Seq Scan
Date: 2015-03-11 22:14:05
Message-ID: CAJrrPGffqj0c94T81zocLC9xb-KtQbVvDUO3hHppjcDVPkj_Ow@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Mar 11, 2015 at 6:31 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Tue, Mar 3, 2015 at 7:47 PM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>> I have modified the patch to introduce a Funnel node (and left child
>> as PartialSeqScan node). Apart from that, some other noticeable
>> changes based on feedback include:
>> a) Master backend forms and send the planned stmt to each worker,
>> earlier patch use to send individual elements and form the planned
>> stmt in each worker.
>> b) Passed tuples directly via tuple queue instead of going via
>> FE-BE protocol.
>> c) Removed restriction of expressions in target list.
>> d) Introduced a parallelmodeneeded flag in plannerglobal structure
>> and set it for Funnel plan.
>>
>> There is still some work left like integrating with
>> access-parallel-safety patch (use parallelmodeok flag to decide
>> whether parallel path can be generated, Enter/Exit parallel mode is still
>> done during execution of funnel node).
>>
>> I think these are minor points which can be fixed once we decide
>> on the other major parts of patch. Find modified patch attached with
>> this mail.
>
> - Something is deeply wrong with the separation of concerns between
> nodeFunnel.c and nodePartialSeqscan.c. nodeFunnel.c should work
> correctly with *any arbitrary plan tree* as its left child, and that
> is clearly not the case right now. shm_getnext() can't just do
> heap_getnext(). Instead, it's got to call ExecProcNode() on its left
> child and let the left child decide what to do about that. The logic
> in InitFunnelRelation() belongs in the parallel seq scan node, not the
> funnel. ExecReScanFunnel() cannot be calling heap_parallel_rescan();
> it needs to *not know* that there is a parallel scan under it. The
> comment in FunnelRecheck is a copy-and-paste from elsewhere that is
> not applicable to a generic funnel mode.

In create_parallelscan_paths() function the funnel path is added once
the partial seq scan
path is generated. I feel the funnel path can be added once on top of
the total possible
parallel path in the entire query path.

Is this the right patch to add such support also?

Regards,
Hari Babu
Fujitsu Australia

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Janes 2015-03-11 22:14:47 Re: Documentation of bt_page_items()'s ctid field
Previous Message Andrew Gierth 2015-03-11 21:54:48 Re: procost for to_tsvector