Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4sKL-0006nO-7F for pgsql-bugs@arkaria.postgresql.org; Thu, 10 Nov 2016 16:35:49 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1c4sKK-0001Bk-Lj for pgsql-bugs@arkaria.postgresql.org; Thu, 10 Nov 2016 16:35:48 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c4sKJ-0001BJ-NX for pgsql-bugs@postgresql.org; Thu, 10 Nov 2016 16:35:47 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c4sKG-0006CP-4i for pgsql-bugs@postgresql.org; Thu, 10 Nov 2016 16:35:47 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id uAAGZgtE020680; Thu, 10 Nov 2016 11:35:42 -0500 From: Tom Lane To: Steve Randall cc: pgsql-bugs@postgresql.org Subject: Re: Parallel Scan Bug: invalid attnum: 0 In-reply-to: <16043.1478792975@sss.pgh.pa.us> References: <23469.1478717448@sss.pgh.pa.us> <16043.1478792975@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Thu, 10 Nov 2016 10:49:35 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20678.1478795742.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 10 Nov 2016 11:35:42 -0500 Message-ID: <20679.1478795742@sss.pgh.pa.us> X-Pg-Spam-Score: -4.8 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org I wrote: > Immediate impression is that the logic for planning partial grouped > aggregation did not get the zero-sort-keys case right. Yeah: after flattening your view, the planner was left with GROUP BY 'S3'::character varying, which is a no-op, but it mistakenly inserted a no-op Sort into the plan to sort by that. One-liner fix is here if you need it right away: https://git.postgresql.org/gitweb/?p=3Dpostgresql.git;a=3Dcommitdiff;h=3D7d= efc3b97a31537547053946808a83e7234d1b61 regards, tom lane --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs