Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iDsyX-0008FI-Gw for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Sep 2019 16:20:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iDsyV-0008L1-Jf for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Sep 2019 16:20:07 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1iDsyV-0008HC-9S for pgsql-hackers@lists.postgresql.org; Fri, 27 Sep 2019 16:20:07 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iDsyS-0004r1-I8 for pgsql-hackers@postgresql.org; Fri, 27 Sep 2019 16:20:06 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1iDsyQ-0004Hf-UA; Fri, 27 Sep 2019 12:20:02 -0400 Date: Fri, 27 Sep 2019 12:20:02 -0400 From: Bruce Momjian To: Thomas Munro Cc: pgsql-hackers , Stephen Frost Subject: Re: Append with naive multiplexing of FDWs Message-ID: <20190927162002.GC31412@momjian.us> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, Sep 4, 2019 at 06:18:31PM +1200, Thomas Munro wrote: > Hello, > > A few years back[1] I experimented with a simple readiness API that > would allow Append to start emitting tuples from whichever Foreign > Scan has data available, when working with FDW-based sharding. I used > that primarily as a way to test Andres's new WaitEventSet stuff and my > kqueue implementation of that, but I didn't pursue it seriously > because I knew we wanted a more ambitious async executor rewrite and > many people had ideas about that, with schedulers capable of jumping > all over the tree etc. > > Anyway, Stephen Frost pinged me off-list to ask about that patch, and > asked why we don't just do this naive thing until we have something > better. It's a very localised feature that works only between Append > and its immediate children. The patch makes it work for postgres_fdw, > but it should work for any FDW that can get its hands on a socket. > > Here's a quick rebase of that old POC patch, along with a demo. Since > 2016, Parallel Append landed, but I didn't have time to think about > how to integrate with that so I did a quick "sledgehammer" rebase that > disables itself if parallelism is in the picture. Yes, sharding has been waiting on parallel FDW scans. Would this work for parallel partition scans if the partitions were FDWs? -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription +