pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Tomas Vondra <tomas.vondra@postgresql.org>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Sample postgres_fdw tables remotely during ANALYZE
Date: Thu, 12 Jan 2023 12:17:46 +0100
Message-ID: <20230112111746.uoowzww6lt2ypldg@alvherre.pgsql> (raw)
In-Reply-To: <E1pBNuo-001DDN-O2@gemulon.postgresql.org>

On 2022-Dec-30, Tomas Vondra wrote:

> Sample postgres_fdw tables remotely during ANALYZE
> 
> When collecting ANALYZE sample on foreign tables, postgres_fdw fetched
> all rows and performed the sampling locally. For large tables this means
> transferring and immediately discarding large amounts of data.
> 
> This commit allows the sampling to be performed on the remote server,
> transferring only the much smaller sample. The sampling is performed
> using the built-in TABLESAMPLE methods (system, bernoulli) or random()
> function, depending on the remote server version.
> 
> Remote sampling can be enabled by analyze_sampling on the foreign server
> and/or foreign table, with supported values 'off', 'auto', 'system',
> 'bernoulli' and 'random'. The default value is 'auto' which uses either
> 'bernoulli' (TABLESAMPLE method) or 'random' (for remote servers without
> TABLESAMPLE support).

You left out the Discussion line, so here's the link:
https://postgr.es/m/151e835f-55d6-ddbc-b5b4-07ee606aba44@enterprisedb.com

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/
"Nunca se desea ardientemente lo que solo se desea por razón" (F. Alexandre)





view thread (2+ messages)

Message-ID: <20230112111746.uoowzww6lt2ypldg@alvherre.pgsql>
Permalink:  ../20230112111746.uoowzww6lt2ypldg@alvherre.pgsql/
Also on:    postgresql.org/message-id/20230112111746.uoowzww6lt2ypldg@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: alvherre@alvh.no-ip.org, tomas.vondra@postgresql.org
  Subject: Re: pgsql: Sample postgres_fdw tables remotely during ANALYZE
  In-Reply-To: <20230112111746.uoowzww6lt2ypldg@alvherre.pgsql>
  References: <E1pBNuo-001DDN-O2@gemulon.postgresql.org> <20230112111746.uoowzww6lt2ypldg@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox