Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eYdRJ-0004eI-Mw for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Jan 2018 19:50:33 +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 1eYdRJ-0000iJ-9x for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Jan 2018 19:50:33 +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 1eYdRJ-0000iA-3S for pgsql-hackers@lists.postgresql.org; Mon, 08 Jan 2018 19:50:33 +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 1eYdRG-0004tV-Gw for pgsql-hackers@lists.postgresql.org; Mon, 08 Jan 2018 19:50:32 +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 w08JoRrI014124; Mon, 8 Jan 2018 14:50:28 -0500 From: Tom Lane To: Robert Haas cc: Amit Kapila , PostgreSQL Hackers Subject: Re: Parallel append plan instability/randomness In-reply-to: <12879.1515439091@sss.pgh.pa.us> References: <7752.1515284083@sss.pgh.pa.us> <12879.1515439091@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Mon, 08 Jan 2018 14:18:11 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <14122.1515441027.1@sss.pgh.pa.us> Date: Mon, 08 Jan 2018 14:50:27 -0500 Message-ID: <14123.1515441027@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I wrote: > In the regression test case at hand, the startup costs are all zero so > this change wouldn't improve the test case's stability. So I'm thinking > that in addition, it would be a good idea for these functions to break > exact compare_path_costs ties in some arbitrary but deterministic way, > rather than letting qsort() have the final say on what happens. If the > subplans were all simple relation scans we could order them by planner > relid, but I'm not sure what to do if they're not. Ah, I have an idea --- let's create a bms_compare() qsort comparator for bitmapsets, and use that on the paths' relid sets. It hardly matters what the exact semantics of the comparator are, as long as it behaves sanely for equal sets. regards, tom lane