Analyze on Foreign Data Wrappers - clarification
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
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.