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 1frkFU-00078S-Vg for pgsql-bugs@arkaria.postgresql.org; Mon, 20 Aug 2018 13:29:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1frkFT-0005f0-6z for pgsql-bugs@arkaria.postgresql.org; Mon, 20 Aug 2018 13:29:35 +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 1frkFS-0005et-To for pgsql-bugs@lists.postgresql.org; Mon, 20 Aug 2018 13:29:35 +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.89) (envelope-from ) id 1frkFQ-0001SC-Fk for pgsql-bugs@lists.postgresql.org; Mon, 20 Aug 2018 13:29:33 +0000 Received: from pro.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w7KDTQVb001309; Mon, 20 Aug 2018 09:29:26 -0400 From: Tom Lane To: Amit Kapila cc: Stephen Frost , Marko Tiikkaja , Andres Freund , Andrew Fletcher , PostgreSQL mailing lists Subject: Re: BUG #15324: Non-deterministic behaviour from parallelised sub-query In-reply-to: References: <21038.1534181205@sss.pgh.pa.us> <390.1534261450@sss.pgh.pa.us> <20180815111006.GB3326@tamriel.snowman.net> Comments: In-reply-to Amit Kapila message dated "Mon, 20 Aug 2018 16:22:25 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <19349.1534771766.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 20 Aug 2018 09:29:26 -0400 Message-ID: <19350.1534771766@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Amit Kapila writes: > On Mon, Aug 20, 2018 at 4:20 PM, Amit Kapila w= rote: >> On Thu, Aug 16, 2018 at 9:25 AM, Amit Kapila = wrote: > On Wed, Aug 15, 2018 at 4:40 PM, Stephen Frost wrot= e: >>> (b) Consider the presence of any window function calculation as >>> parallel-restricted operation. >> For this, we need to mark all the window functions like row_number, >> rank, dense_rank, etc as parallel-restricted. Additionally, we also >> need to detect the presence of aggregate functions that act as window >> functions (when an OVER clause follows the call). Attached patch >> treat_window_func_calc_parallel_restricted_v1 implements the fix. > As this patch changes the catalog contents, we need to bump catalog > version number. However, I have left it for later once we get a > review and or testing of the patch. Sounds to me like you're using the wrong approach. I would just consider any Agg or WindowFunc node as parallel-restricted regardless of the function it references. regards, tom lane