Analyze on Foreign Data Wrappers - clarification

Started by PG Bug reporting formover 4 years ago2 messagesdocs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/14/sql-analyze.html
Description:

Foreign tables are analyzed only when explicitly selected.

Nothing wrong just maybe my newness to PG. I don't understand what
"selected" means here:
1. When I select the table in a query
2. When I run the analyze command with the FDW table as a parameter
3. Or something else

Also, I am not clear if analyze is run on FDW tables when Automvacuum runs;
does it run analyze on FDW tables by default.

Thanks,
Leon

#2David G. Johnston
david.g.johnston@gmail.com
In reply to: PG Bug reporting form (#1)
Re: Analyze on Foreign Data Wrappers - clarification

On Monday, October 11, 2021, PG Doc comments form <noreply@postgresql.org>
wrote:

Foreign tables are analyzed only when explicitly selected.

2. When I run the analyze command with the FDW table as a parameter

That

Also, I am not clear if analyze is run on FDW tables when Automvacuum runs;
does it run analyze on FDW tables by default.

Based on the prior item I would expect no. It would usually have
insufficient data to do otherwise.

I didn’t look hard but aside from this comment about analyze working on
foreign tables, if asked, I find no relevant “why” discussion regarding the
interaction of analyze and foreign tables in the documentation. Frankly,
I’m unsure why it even needs to work at all.

David J.