Re: analyze foreign tables

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: richard coleman <rcoleman(dot)ascentgl(at)gmail(dot)com>
Cc: Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: analyze foreign tables
Date: 2023-08-03 14:19:19
Message-ID: CAMkU=1x5m60yaz5sriL12LF=53C8PTZbGiOGtb0Z159nTDKSrg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers pgadmin-support pgsql-admin

On Tue, Aug 1, 2023 at 9:47 AM richard coleman <rcoleman(dot)ascentgl(at)gmail(dot)com>
wrote:

>
> use_remote_estimate isn't really a solution as it adds way too much
> overhead and processing time to every query run.
>

Maybe this is the thing which should be addressed. Can you quantify what
you see here? How much overhead is being added for each query? Is this
principally processing time, or network latency?

Since these tables are being continuously analyzed in the database that
> hosts the data, is there some way that they statistics could be easily
> passed through the foreign server mechanism to the remote database that's
> calling the query?
>

Since FDW can cross version boundaries, it is hard to see how this would
work. Maybe something could be done for the special case of where the
versions match. I think collations/encoding would be a problem, though.

> What I am hoping for is either:
>
> 2. add the ability to automatically run analyze on foreign tables just as
> they are currently run on local tables.
>

That wouldn't work because communication is always initiated on the wrong
side. But it should be fairly easy to script something outside of the
database which would connect to both, and poll the "foreign"
pg_stat_all_tables.last_autovacuum and initiate a local ANALYZE for each
table which was recently autoanalyzed on the foreign side.

Cheers,

Jeff

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message richard coleman 2023-08-03 16:16:14 Re: analyze foreign tables
Previous Message richard coleman 2023-08-03 13:02:45 Re: analyze foreign tables

Browse pgadmin-support by date

  From Date Subject
Next Message richard coleman 2023-08-03 16:16:14 Re: analyze foreign tables
Previous Message richard coleman 2023-08-03 13:02:45 Re: analyze foreign tables

Browse pgsql-admin by date

  From Date Subject
Next Message richard coleman 2023-08-03 16:16:14 Re: analyze foreign tables
Previous Message richard coleman 2023-08-03 13:02:45 Re: analyze foreign tables