Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1azmrf-0005fR-93 for pgsql-hackers@arkaria.postgresql.org; Mon, 09 May 2016 15:12:55 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1azmre-0000CD-KQ for pgsql-hackers@arkaria.postgresql.org; Mon, 09 May 2016 15:12:54 +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 1azmqJ-00078M-9v for pgsql-hackers@postgresql.org; Mon, 09 May 2016 15:11:31 +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 1azmqF-0003RM-Fq for pgsql-hackers@postgresql.org; Mon, 09 May 2016 15:11:30 +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 u49FBOdx016868; Mon, 9 May 2016 11:11:24 -0400 From: Tom Lane To: Andres Freund cc: Robert Haas , PostgreSQL-development Subject: Re: parallel.c is not marked as test covered In-reply-to: <20160509145023.tkdpyygfxu56ngzz@alap3.anarazel.de> References: <20160509012055.GA433959@alvherre.pgsql> <20160509145023.tkdpyygfxu56ngzz@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Mon, 09 May 2016 07:50:23 -0700" Date: Mon, 09 May 2016 11:11:24 -0400 Message-ID: <16867.1462806684@sss.pgh.pa.us> X-Pg-Spam-Score: -4.0 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Andres Freund writes: > I think it's a good idea to run a force-parallel run on some buildfarm > members. Noah's already doing that on at least one of his critters. But some more wouldn't hurt. > But I'm rather convinced that the core tests run by all animals > need some minimal coverage of parallel queries. Both because otherwise > it'll be hard to get some coverage of unusual platforms, and because > it's imo something rather relevant to test during development. +1. Experimenting with what we might do, it seems like it's harder to get the planner to use a parallel plan than you would think. regression=# explain select count(*) from tenk1; QUERY PLAN -------------------------------------------------------------------------------- ------------------- Aggregate (cost=295.29..295.30 rows=1 width=8) -> Index Only Scan using tenk1_thous_tenthous on tenk1 (cost=0.29..270.29 r ows=10000 width=0) (2 rows) regression=# set enable_indexscan TO 0; SET regression=# explain select count(*) from tenk1; QUERY PLAN ----------------------------------------------------------------- Aggregate (cost=483.00..483.01 rows=1 width=8) -> Seq Scan on tenk1 (cost=0.00..458.00 rows=10000 width=0) (2 rows) regression=# set force_parallel_mode TO on; SET regression=# explain select count(*) from tenk1; QUERY PLAN ----------------------------------------------------------------- Aggregate (cost=483.00..483.01 rows=1 width=8) -> Seq Scan on tenk1 (cost=0.00..458.00 rows=10000 width=0) (2 rows) Methinks force_parallel_mode is a bit broken. Also, once you *do* get it to make a parallel plan: regression=# create table foo as select generate_series(1,1000000) g; SELECT 1000000 regression=# analyze foo; ANALYZE regression=# explain select count(*) from foo; QUERY PLAN -------------------------------------------------------------------------------------- Finalize Aggregate (cost=10633.55..10633.56 rows=1 width=8) -> Gather (cost=10633.33..10633.54 rows=2 width=8) Workers Planned: 2 -> Partial Aggregate (cost=9633.33..9633.34 rows=1 width=8) -> Parallel Seq Scan on foo (cost=0.00..8591.67 rows=416667 width=0) (5 rows) regression=# explain (costs off) select count(*) from foo; QUERY PLAN -------------------------------------------- Finalize Aggregate -> Gather Workers Planned: 2 -> Partial Aggregate -> Parallel Seq Scan on foo (5 rows) That's not going to do for a regression-test case because it will break anytime somebody changes the value of max_parallel_degree. Maybe we should suppress the "Workers Planned" field in costs-off display mode? regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers