pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: richard coleman <rcoleman.ascentgl@gmail.com>
To: Pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: Re: analyze foreign tables
Date: Thu, 03 Aug 2023 14:37:11 +0200
Message-ID: <615ccd4a1de716c229cf125260896051b1989608.camel@cybertec.at> (raw)
In-Reply-To: <CAGA3vBt726ha1P91DrSOF8oc57X27tLO8o9Wi9oDN5L3qqRi7Q@mail.gmail.com>
References: <CAGA3vBt726ha1P91DrSOF8oc57X27tLO8o9Wi9oDN5L3qqRi7Q@mail.gmail.com>

On Tue, 2023-08-01 at 09:47 -0400, richard coleman wrote:
> In PostgreSQL foreign tables are not automatically analyzed and analyze must be
> specifically called on each table.  In the case of sharing tables between PostgreSQL
> clusters, there is the use_remote_estimate foreign server option.
> 
> In some of our multi terabyte databases, manually running analyze on all of the
> foreign tables can take more than a day.  This is per database containing the
> foreign schema.  Since we have certain large schema that we have centrally located
> and share to all of our other database clusters, this really adds up.

I just saw that PostgreSQL v16 uses remote sampling for ANALYZE on foreign tables.
This is governed by the option "analyze_sampling" on the foreign table or the foreign
server, and the default value "auto" should be just what you need.

Yours,
Laurenz Albe





view thread (12+ messages)  latest in thread

Message-ID: <615ccd4a1de716c229cf125260896051b1989608.camel@cybertec.at>
Permalink:  ../615ccd4a1de716c229cf125260896051b1989608.camel@cybertec.at/
Also on:    postgresql.org/message-id/615ccd4a1de716c229cf125260896051b1989608.camel@cybertec.at

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: laurenz.albe@cybertec.at, rcoleman.ascentgl@gmail.com, pgsql-admin@lists.postgresql.org
  Subject: Re: analyze foreign tables
  In-Reply-To: <615ccd4a1de716c229cf125260896051b1989608.camel@cybertec.at>

* 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