Re: analyze foreign tables

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: richard coleman <rcoleman(dot)ascentgl(at)gmail(dot)com>, Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: analyze foreign tables
Date: 2023-08-04 14:48:00
Message-ID: CAMkU=1yu3C1bMHBoMovVMbMZ_WLnh3sdh7WxUcwUbiBWGvPsbQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers pgadmin-support pgsql-admin

On Thu, Aug 3, 2023 at 8:37 AM Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
wrote:

> 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.
>
>
In addition to this new feature, analyzing foreign tables can also be
highly dependent on an old feature, fetch_size. The default fetch_size is
really quite small and might be a bottleneck for ANALYZE.

Cheers,

Jeff

In response to

Browse pgadmin-hackers by date

  From Date Subject
Next Message Sandy Haas 2023-08-04 22:39:47 RE: Saved SQL queries will not execute
Previous Message Khushboo Vashi 2023-08-04 10:07:44 [pgadmin-org/pgadmin4] ac50b4: Another attempt to fix rpm build failure for SBOM.

Browse pgadmin-support by date

  From Date Subject
Next Message Martin Paredes 2023-08-06 04:37:30 Re: FW: please pgadmin4 localhost server start error
Previous Message Дмитрий Иванов 2023-08-04 01:46:50 Re:

Browse pgsql-admin by date

  From Date Subject
Next Message vrms 2023-08-05 10:26:39 Re: pgAgent installation issue
Previous Message Jeff Janes 2023-08-04 13:48:33 Re: Archive cleanup