Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bA9ZN-0006Go-Nq for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Jun 2016 05:28:53 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bA9ZN-0001dZ-9N for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Jun 2016 05:28:53 +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 1bA9Y0-00007d-UZ for pgsql-hackers@postgresql.org; Tue, 07 Jun 2016 05:27:29 +0000 Received: from mail-pf0-x22a.google.com ([2607:f8b0:400e:c00::22a]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bA9Xt-0004Ut-Lz for pgsql-hackers@postgresql.org; Tue, 07 Jun 2016 05:27:27 +0000 Received: by mail-pf0-x22a.google.com with SMTP id 62so74167465pfd.1 for ; Mon, 06 Jun 2016 22:27:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=7fw/tit8Eq4fjtIN0UtfgFex8jOSWPwbG0F2Yvi+n3A=; b=PtMta+xJfhd5o8jzMHvxVOi4wayey0lFu4YhdyiC4C9Zw7rXm2xmu8mjJB8asQ2GbE MCiZ7v2KYVPAhFUFBNgn5/bfoJWMLK4VNjOB5WXX28DwyauiOM5cPvNJ+uWdG6NhIhed PrNB8NRsA9rgbrBp8r5YRRn9Ua/gLYSNW9qVg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=7fw/tit8Eq4fjtIN0UtfgFex8jOSWPwbG0F2Yvi+n3A=; b=dtXylb+iz1v/xodrh8AzWBLzKk0nQb3ydsR77v9npnK7us3hlnLhvFP9XJDgz1W6pH 8fIatWiPAU/k2FxAPdr2LNAIKxIpcWD9SX9CizZn17lNvwBY3XeNORDfF5vfGvxIRqP6 B+RpymWb74cE5Dbk6URI/wQa+qzfPi3b6W9R7LPbwTgozUc5BZRupQrblYbaYI81TFY4 go5e7TpFUDytP3PJXCCTuNXXPcQOn4OYSNliZZsN6R8zCfcuM5+m8XAfPFEv28MUIFGA zo38+0AqSzR0o7mAsvFfgUyXD54A9rq4S1paPP/wp4wOgWPGNMs8LIS68Gicajn9HKBg jIUg== X-Gm-Message-State: ALyK8tJ9d9Qlvdn0pj9M+oWInECEBlTuPxM9p3al0XGWdEAv2aVK+TyOpm5Z1BIgR0Bf9w== X-Received: by 10.98.104.133 with SMTP id d127mr30098828pfc.154.1465277239863; Mon, 06 Jun 2016 22:27:19 -0700 (PDT) Received: from tornado.leadboat.com (c-98-248-47-228.hsd1.ca.comcast.net. [98.248.47.228]) by smtp.gmail.com with ESMTPSA id ce8sm29306637pad.44.2016.06.06.22.27.17 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Jun 2016 22:27:18 -0700 (PDT) Date: Tue, 7 Jun 2016 01:27:16 -0400 From: Noah Misch To: =?iso-8859-1?Q?Cl=E9ment_Pr=E9vost?= Cc: Andres Freund , Alvaro Herrera , David Rowley , PostgreSQL-development Subject: Re: parallel.c is not marked as test covered Message-ID: <20160607052716.GA766951@tornado.leadboat.com> References: <20160509012055.GA433959@alvherre.pgsql> <20160509145023.tkdpyygfxu56ngzz@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Pg-Spam-Score: -2.7 (--) 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 Thanks for this patch. I have reviewed it: On Sun, May 15, 2016 at 12:53:13PM +0000, Clément Prévost wrote: > After some experiments, I found out that, for my setup (9b7bfc3a88ef7b), a > parallel seq scan is used given both parallel_setup_cost > and parallel_tuple_cost are set to 0 and given that the table is at least 3 > times as large as the biggest test table tenk1. That worked because it pushed the table over the create_plain_partial_paths() 1000-block (8 MiB) threshold; see http://www.postgresql.org/message-id/26842.1462941248@sss.pgh.pa.us While the way you tested this is not wrong, I recommend instead querying an inheritance parent if that achieves no less test coverage. "SELECT count(*) FROM a_star" gets a parallel plan under your cost parameters. That avoids building and discarding a relatively-large table. > The attached patch is a regression test using this method that is > reasonably small and fast to run. I also hid the workers count from the > explain output when costs are disabled as suggested by Tom Lane and Robert > Haas on this same thread ( > http://www.postgresql.org/message-id/CA+TgmobBQS4ss3+CwoZOKgbsBqKfRndwc=hLiALAep5aXQCTDA@mail.gmail.com > ). It seems wrong to me for COSTS OFF to disable output that is not a cost estimate. file_fdw did that, but I don't want to proliferate that loose interpretation of COSTS OFF. Unlike the example in the linked-to message, this test won't experience variable worker count. For the query you used and for the a_star query, low input size makes the planner request exactly one worker. If later planner enhancements give this query a configuration-specific worker count, the test could capture EXPLAIN output with PL/pgSQL and compare it to a regex. > Testing under these conditions does not test the planner job at all but at > least some parallel code can be run on the build farm and the test suite > gets 2643 more lines and 188 more function covered. Nice. > --- a/src/test/regress/parallel_schedule > +++ b/src/test/regress/parallel_schedule > @@ -79,7 +79,7 @@ ignore: random > # ---------- > # Another group of parallel tests > # ---------- > -test: select_into select_distinct select_distinct_on select_implicit select_having subselect union case join aggregates transactions random portals arrays btree_index hash_index update namespace prepared_xacts delete > +test: select_into select_distinct select_distinct_on select_implicit select_having subselect union case join aggregates transactions random portals arrays btree_index hash_index update namespace prepared_xacts delete select_parallel Add this to serial_schedule, too. > --- /dev/null > +++ b/src/test/regress/sql/select_parallel.sql > @@ -0,0 +1,22 @@ > +-- > +-- PARALLEL > +-- > + > +-- setup parallel test > +create unlogged table tenk_parallel as table tenk1 with no data; > +set parallel_setup_cost=0; > +set parallel_tuple_cost=0; > + > +-- create a table with enough data to trigger parallel behavior > +insert into tenk_parallel > + select tenk1.* from tenk1, generate_series(0,2); > + > +explain (costs off) > + select count(*) from tenk_parallel; > +select count(*) from tenk_parallel; As of today, "make installcheck" passes with "default_transaction_isolation = serializable" in postgresql.conf. Let's preserve that property. You could wrap the parallel queries in "begin isolation level repeatable read;" ... "commit;", or you could SET default_transaction_isolation itself. > + > +-- cleanup > +drop table tenk_parallel; > +set parallel_setup_cost to default; > +set parallel_tuple_cost to default; > + Remove the trailing blank line; it triggers a "git diff --check" diagnostic. [Official open item status update: I expect to be able to review the next patch version within a day or two of it becoming available. I will update this thread by 2016-06-14 09:00 UTC if not earlier.] -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers