Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cBl7n-0000un-A3 for pgsql-bugs@arkaria.postgresql.org; Tue, 29 Nov 2016 16:19:19 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cBl7m-0003lb-Py for pgsql-bugs@arkaria.postgresql.org; Tue, 29 Nov 2016 16:19:18 +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.84_2) (envelope-from ) id 1cBl7l-0003iY-Hq for pgsql-bugs@postgresql.org; Tue, 29 Nov 2016 16:19:17 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cBl7j-0005B9-0U for pgsql-bugs@postgresql.org; Tue, 29 Nov 2016 16:19:16 +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 uATGJDLC022909; Tue, 29 Nov 2016 11:19:13 -0500 From: Tom Lane To: Michael Day cc: pgsql-bugs@postgresql.org Subject: Re: parallel sequential scan returns extraneous rows In-reply-to: References: Comments: In-reply-to Michael Day message dated "Tue, 29 Nov 2016 09:39:28 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <22907.1480436353.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 29 Nov 2016 11:19:13 -0500 Message-ID: <22908.1480436353@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 Michael Day writes: > I have found a nasty bug when using parallel sequential scans with an exi= sts clause on postgresql 9.6.1. I have found that the rows returned using = parallel sequential scan plans are incorrect (though I haven=E2=80=99t dug = sufficiently to know in what ways). See below for an example of the issue. Hm, looks like a planner error: it seems to be forgetting that the join to "address" should be a semijoin. "address" should either be on the inside of a "Semi" join (as in your first, correct-looking plan) or be passed through a unique-ification stage such as a HashAgg. Clearly, neither thing is happening in the second plan. I couldn't reproduce this in a bit of trying, however. Can you come up with a self-contained test case? 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