Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nIZtd-0002kD-2s for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Feb 2022 17:39:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nIZtb-0002C0-QK for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Feb 2022 17:39:47 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nIZtb-0002Bp-Gx for pgsql-hackers@lists.postgresql.org; Fri, 11 Feb 2022 17:39:47 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nIZtY-0007g2-TM for pgsql-hackers@lists.postgresql.org; Fri, 11 Feb 2022 17:39:46 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 21BHdhwl2080022; Fri, 11 Feb 2022 12:39:43 -0500 From: Tom Lane To: Tomas Vondra cc: PostgreSQL Hackers Subject: Re: postgres_fdw: using TABLESAMPLE to collect remote sample In-reply-to: <151e835f-55d6-ddbc-b5b4-07ee606aba44@enterprisedb.com> References: <151e835f-55d6-ddbc-b5b4-07ee606aba44@enterprisedb.com> Comments: In-reply-to Tomas Vondra message dated "Fri, 11 Feb 2022 18:02:37 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2080020.1644601183.1@sss.pgh.pa.us> Date: Fri, 11 Feb 2022 12:39:43 -0500 Message-ID: <2080021.1644601183@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Tomas Vondra writes: > So here we go. The patch does a very simple thing - it uses TABLESAMPLE > to collect/transfer just a small sample from the remote node, saving > both CPU and network. This is great if the remote end has TABLESAMPLE, but pre-9.5 servers don't, and postgres_fdw is supposed to still work with old servers. So you need some conditionality for that. regards, tom lane