Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eYQSn-0005YV-IJ for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Jan 2018 05:59:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eYQSm-0006lo-St for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Jan 2018 05:59:12 +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 1eYQQ7-0001AW-HW for pgsql-hackers@lists.postgresql.org; Mon, 08 Jan 2018 05:56:27 +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.89) (envelope-from ) id 1eYQQ4-0003qB-CJ for pgsql-hackers@lists.postgresql.org; Mon, 08 Jan 2018 05:56:26 +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 w085uLrH007401; Mon, 8 Jan 2018 00:56:21 -0500 From: Tom Lane To: Amit Khandekar cc: Amit Kapila , PostgreSQL Hackers Subject: Re: Parallel append plan instability/randomness In-reply-to: References: <7752.1515284083@sss.pgh.pa.us> Comments: In-reply-to Amit Khandekar message dated "Mon, 08 Jan 2018 11:11:29 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <7399.1515390981.1@sss.pgh.pa.us> Date: Mon, 08 Jan 2018 00:56:21 -0500 Message-ID: <7400.1515390981@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Amit Khandekar writes: > The fact that b_star gets moved from 5th position to the first > position in the scans, indicates that it's cost shoots up from 1.04 to > a value greater than 1.16. It does not look like a case where two > costs are almost same due to which their positions swap sometimes. I > am trying to figure out what else can it be ... The gut feeling I had upon seeing the failure was that the plan shape depends on the order in which rows happen to be read from the system catalogs by a heapscan. I've not tried to run that idea to ground yet. regards, tom lane