Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eXybw-0007le-Hw for pgsql-hackers@arkaria.postgresql.org; Sun, 07 Jan 2018 00:14:48 +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 1eXybv-0004tM-MH for pgsql-hackers@arkaria.postgresql.org; Sun, 07 Jan 2018 00:14:47 +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 1eXybv-0004tD-Fl for pgsql-hackers@lists.postgresql.org; Sun, 07 Jan 2018 00:14: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.89) (envelope-from ) id 1eXybt-00066e-41 for pgsql-hackers@lists.postgresql.org; Sun, 07 Jan 2018 00:14: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 w070Ehh2007753 for ; Sat, 6 Jan 2018 19:14:43 -0500 From: Tom Lane To: pgsql-hackers@lists.postgresql.org Subject: Parallel append plan instability/randomness MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <7751.1515284083.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 06 Jan 2018 19:14:43 -0500 Message-ID: <7752.1515284083@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk According to buildfarm member silverfish, https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=3Dsilverfish&dt=3D= 2018-01-06%2008%3A53%3A38 it's possible to sometimes get this failure in the regression tests: *** /mnt/buildfarm/buildroot/HEAD/pgsql.build/../pgsql/src/test/regress/ex= pected/select_parallel.out Tue Dec 19 20:24:02 2017 --- /mnt/buildfarm/buildroot/HEAD/pgsql.build/src/test/regress/results/sel= ect_parallel.out Sat Jan 6 09:21:39 2018 *************** *** 75,84 **** Workers Planned: 3 -> Partial Aggregate -> Parallel Append -> Seq Scan on d_star -> Seq Scan on f_star -> Seq Scan on e_star - -> Seq Scan on b_star -> Seq Scan on c_star -> Seq Scan on a_star (11 rows) --- 75,84 ---- Workers Planned: 3 -> Partial Aggregate -> Parallel Append + -> Seq Scan on b_star -> Seq Scan on d_star -> Seq Scan on f_star -> Seq Scan on e_star -> Seq Scan on c_star -> Seq Scan on a_star (11 rows) Irreproducible failures in the regression tests are not very acceptable. Furthermore, considering that the query being tested is explain (costs off) select round(avg(aa)), sum(aa) from a_star; it seems to me that the "expected" order of the sub-scans is mighty random to begin with. A non-parallel implementation of the same query will consistently scan these tables in their inheritance order: Aggregate -> Append -> Seq Scan on a_star -> Seq Scan on b_star -> Seq Scan on c_star -> Seq Scan on d_star -> Seq Scan on e_star -> Seq Scan on f_star Could we fix the parallel case to behave similarly please? regards, tom lane