Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fg8kI-0000c6-Mu for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Jul 2018 13:13:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fg8kG-0003H0-Pd for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Jul 2018 13:13:24 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fg8kG-0003Gr-Ev for pgsql-hackers@lists.postgresql.org; Thu, 19 Jul 2018 13:13:24 +0000 Received: from mail-lj1-f193.google.com ([209.85.208.193]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fg8kD-0003lw-Na for pgsql-hackers@postgresql.org; Thu, 19 Jul 2018 13:13:23 +0000 Received: by mail-lj1-f193.google.com with SMTP id f8-v6so7424864ljk.1 for ; Thu, 19 Jul 2018 06:13:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=jZzV/oGVC3/wx0kErZIv//9P+1/CaLtF4PUEOqApGks=; b=JQgpeMBMFSpYF5C8j9A1EbBqMU04Y2sSax4hBSBOpsbp8K4jWw2AJe1MkvIAG7GO+d 19jBNNQWGGOAb1/2BR8+FV1Qg2IF/zNst8M7SeKL19UdRFhkBERkm6FOy9imza6w1dRF c9vhe/W6odZmvkaZGfPXJaUmMizN97sls31AGH+V5VdCbW7mil9HKhNi0nWQRE/dL6N2 epX0c0B4mDE0twJ/+eDU5jwHjdCODzPTtooNfL7zordCmasW88mFSyOVDBv9t/6KIuPD THl0v6xbqtOQZ1IBFbJu6mPaptofQfCXC4LW00onizNh08rXnb7mP2vf/LZy3ui1yGtA QxrQ== X-Gm-Message-State: AOUpUlGvzw5clW5ED/n/BoDLxnpLhLU5Fy3unfZo0rNUMjvviZhKdooJ UeoVtNgIN9lZ4hYgqLriE9U= X-Google-Smtp-Source: AAOMgpdftBe91Vad+AI9bqedXF/GiCnsCYRouhWLOiGNzlZDjVi38eDZwDjhA+NJgWCFMKa9ZngXTA== X-Received: by 2002:a19:f70d:: with SMTP id z13-v6mr6509209lfe.33.1532005999818; Thu, 19 Jul 2018 06:13:19 -0700 (PDT) Received: from [192.168.1.11] (dsl-hkibng32-54fbf8-78.dhcp.inet.fi. [84.251.248.78]) by smtp.gmail.com with ESMTPSA id g23-v6sm957703lfl.42.2018.07.19.06.13.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Jul 2018 06:13:19 -0700 (PDT) Subject: Re: pgsql: Fix parallel index and index-only scans to fall back to serial. To: Robert Haas Cc: pgsql-hackers , Amit Kapila , David G Johnston References: <1fec9022-41e8-e484-70ce-2179b08c2092@iki.fi> From: Heikki Linnakangas Message-ID: <3495a1e1-d24a-3973-62c5-ce46dbffd567@iki.fi> Date: Thu, 19 Jul 2018 16:13:18 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 14/07/18 00:56, Robert Haas wrote: > On Fri, Jul 13, 2018 at 2:22 PM, Heikki Linnakangas 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. Ah, gotcha. I changed that (and the other copies) per David's suggestion. - Heikki