Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dQ8Ge-0000t3-9C for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Jun 2017 08:24:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dQ8Gd-0000Ei-SI for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Jun 2017 08:24:07 +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 1dQ8Gc-00009y-Li for pgsql-hackers@postgresql.org; Wed, 28 Jun 2017 08:24:06 +0000 Received: from mx2.mailbox.org ([80.241.60.215]) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dQ8GY-0000Ur-Oi for pgsql-hackers@postgresql.org; Wed, 28 Jun 2017 08:24:05 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id AEEB0458A5; Wed, 28 Jun 2017 10:23:57 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter01.heinlein-hosting.de (spamfilter01.heinlein-hosting.de [80.241.56.115]) (amavisd-new, port 10030) with ESMTP id jbmDe3sFjRzf; Wed, 28 Jun 2017 10:23:55 +0200 (CEST) From: Antonin Houska To: Kyotaro HORIGUCHI cc: pgsql-hackers@postgresql.org Subject: Re: asynchronous execution In-reply-to: <20170622.141720.190958545.horiguchi.kyotaro@lab.ntt.co.jp> References: <20170404.192539.29699823.horiguchi.kyotaro@lab.ntt.co.jp> <20170522.131214.20936668.horiguchi.kyotaro@lab.ntt.co.jp> <20170522.142253.40733906.horiguchi.kyotaro@lab.ntt.co.jp> <20170622.141720.190958545.horiguchi.kyotaro@lab.ntt.co.jp> Comments: In-reply-to Kyotaro HORIGUCHI message dated "Thu, 22 Jun 2017 14:17:20 +0900." MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Date: Wed, 28 Jun 2017 10:23:54 +0200 Message-ID: <4579.1498638234@localhost> 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 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Kyotaro HORIGUCHI wrote: > The patch got conflicted. This is a new version just rebased to > the current master. Furtuer amendment will be taken later. Can you please explain this part of make_append() ? /* Currently async on partitioned tables is not available */ Assert(nasyncplans =3D=3D 0 || partitioned_rels =3D=3D NIL); I don't think the output of Append plan is supposed to be ordered even if t= he underlying relation is partitioned. Besides ordering, is there any other reason not to use the asynchronous execution? And even if there was some, the planner should ensure that executor does not fire the assertion statement above. The script attached shows an example how to cause the assertion failure. --=20 Antonin Houska Cybertec Sch=C3=B6nig & Sch=C3=B6nig GmbH Gr=C3=B6hrm=C3=BChlgasse 26 A-2700 Wiener Neustadt Web: http://www.postgresql-support.de, http://www.cybertec.at --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=async_append_test.sh OPT_HOST="-h localhost" USER=postgres for x in $(psql $OPT_HOST -c "SELECT datname FROM pg_database WHERE datname ~ 'shard.*' " postgres -A -t) do echo dropping $x dropdb $OPT_HOST $x done; createdb $OPT_HOST shard psql $OPT_HOST -U $USER shard -c " CREATE EXTENSION postgres_fdw; CREATE TABLE orders(customer_id int, product_id int) PARTITION BY LIST (customer_id);" createdb $OPT_HOST shard_0 psql $OPT_HOST -U $USER shard_0 -c " CREATE TABLE orders_0 AS SELECT trunc(2 * random())::int AS customer_id, trunc(100 * random())::int AS product_id FROM generate_series(1, 5000); ANALYZE;" psql $OPT_HOST -U $USER shard -c " CREATE SERVER server_0 FOREIGN DATA WRAPPER postgres_fdw OPTIONS (host 'localhost', dbname 'shard_0', fetch_size '1000', use_remote_estimate 'true', fdw_tuple_cost '10'); CREATE USER MAPPING FOR CURRENT_USER SERVER server_0 OPTIONS (user '$USER'); IMPORT FOREIGN SCHEMA public FROM SERVER server_0 INTO public; ALTER TABLE orders ATTACH PARTITION orders_0 FOR VALUES IN (0, 1);" createdb $OPT_HOST shard_1 psql $OPT_HOST -U $USER shard_1 -c " CREATE TABLE orders_1 AS SELECT trunc(2 * random())::int + 2 AS customer_id, trunc(100 * random())::int + 2 AS product_id FROM generate_series(1, 5000); ANALYZE;" psql $OPT_HOST -U $USER shard -c " CREATE SERVER server_1 FOREIGN DATA WRAPPER postgres_fdw OPTIONS (host 'localhost', dbname 'shard_1', fetch_size '1000', use_remote_estimate 'true', fdw_tuple_cost '10'); CREATE USER MAPPING FOR CURRENT_USER SERVER server_1 OPTIONS (user '$USER'); IMPORT FOREIGN SCHEMA public FROM SERVER server_1 INTO public; ALTER TABLE orders ATTACH PARTITION orders_1 FOR VALUES IN (2, 3);" psql $OPT_HOST -U $USER shard -c "SELECT * FROM orders" --=-=-= Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --=-=-=--