Re: [HACKERS] parallel index(-only) scan breaks when run without parallelism - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: [HACKERS] parallel index(-only) scan breaks when run without parallelism
Date
Msg-id CAA4eK1Kq5qb_u2AOoda5XBB91vVWz90w=LgtRLgsssriS8pVTw@mail.gmail.com
Whole thread Raw
In response to [HACKERS] parallel index(-only) scan breaks when run without parallelism  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On Wed, Mar 8, 2017 at 12:27 AM, Robert Haas <robertmhaas@gmail.com> wrote:
> Amit, Rafia,
>
> nodeIndexscan.c, unlike nodeSeqscan.c, thinks that a parallel-aware
> scan will always be executed in parallel mode.  But that's not true:
> an Execute message with a non-zero row count could cause us to abandon
> planned parallelism and execute the plan serially.
>

Right, and the current code had assumed that if there is a parallel
plan then it will always enter the parallel mode.   I think the fix is
quite similar to what we do in nodeSeqscan.c i.e. initialize the scan
descriptor before starting the scan if it is not already initialized.
 There is an additional check required for ensuring if index runtime
keys are ready before calling index_rescan.  Attached patch fixes the
problem.


-- 
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachment

pgsql-hackers by date:

Previous
From: Amit Khandekar
Date:
Subject: Re: [HACKERS] Parallel Append implementation
Next
From: Michael Paquier
Date:
Subject: Re: [HACKERS] Enabling replication connections by default in pg_hba.conf