Re: pgsql: Fix parallel index and index-only scans to fall back to serial. - Mailing list pgsql-hackers

From Robert Haas
Subject Re: pgsql: Fix parallel index and index-only scans to fall back to serial.
Date
Msg-id CA+Tgmob-2ThLYikNPiRi12W3w16e920VVYUqh=_e9gCw4vnbWw@mail.gmail.com
Whole thread Raw
In response to Re: pgsql: Fix parallel index and index-only scans to fall back toserial.  (Heikki Linnakangas <hlinnaka@iki.fi>)
Responses Re: pgsql: Fix parallel index and index-only scans to fall back toserial.  (Heikki Linnakangas <hlinnaka@iki.fi>)
List pgsql-hackers
On Fri, Jul 13, 2018 at 2:22 PM, Heikki Linnakangas <hlinnaka@iki.fi> wrote:
> I just bumped into this comment, from commit 09529a70bb5, and I can't make
> sense of it:
>
>> +               /*
>> +                * We reach here if the index only scan is not parallel,
>> or if we're
>> +                * executing a index only scan that was intended to be
>> parallel
>> +                * serially.
>> +                */
>
>
> What was that intended to say?

There are two ways that you can reach that code.  One is that you have
the thing that shows up in EXPLAIN output as "Index-Only Scan".  The
other is that you have the thing that shows up in EXPLAIN output as
"Parallel Index-Only Scan", but you didn't get any workers, so now
you're falling back to running what was intended to be a parallel plan
without parallelism i.e. serially.  The comment is intended to alert
you to the fact that an intended-as-parallel scan can end up here in
corner cases where the plan doesn't end up being parallel.  We've had
some difficulty in consistently getting that case correct.

If you decide to rephase the comment for clarity, note that there are
three other near-copies of it cf. git grep -C4 'We reach here if'

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Nikita Glukhov
Date:
Subject: Re: [HACKERS] [PATCH] kNN for SP-GiST
Next
From: Kefan Yang
Date:
Subject: Fwd: GSOC 2018 Project - A New Sorting Routine