postgresql/contrib/postgres_fdw
Etsuro Fujita 28972b6fc3 Add support for importing statistics from remote servers.
Add a new FDW callback routine that allows importing remote statistics
for a foreign table directly to the local server, instead of collecting
statistics locally.  The new callback routine is called at the beginning
of the ANALYZE operation on the table, and if the FDW failed to import
the statistics, the existing callback routine is called on the table to
collect statistics locally.

Also implement this for postgres_fdw.  It is enabled by "restore_stats"
option both at the server and table level.  Currently, it is the user's
responsibility to ensure remote statistics to import are up-to-date, so
the default is false.

Author: Corey Huinker <corey.huinker@gmail.com>
Co-authored-by: Etsuro Fujita <etsuro.fujita@gmail.com>
Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Reviewed-by: Matheus Alcantara <matheusssilv97@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Etsuro Fujita <etsuro.fujita@gmail.com>
Discussion: https://postgr.es/m/CADkLM%3DchrYAx%3DX2KUcDRST4RLaRLivYDohZrkW4LLBa0iBhb5w%40mail.gmail.com
2026-04-08 19:15:00 +09:00
..
expected Add support for importing statistics from remote servers. 2026-04-08 19:15:00 +09:00
specs postgres_fdw: Add more test coverage for EvalPlanQual testing. 2025-11-06 12:15:00 +09:00
sql Add support for importing statistics from remote servers. 2026-04-08 19:15:00 +09:00
t ALTER SUBSCRIPTION ... SERVER test. 2026-03-18 10:15:51 -07:00
.gitignore Fix EvalPlanQual handling of foreign/custom joins in ExecScanFetch. 2025-10-15 17:15:00 +09:00
connection.c postgres_fdw: Inherit the local transaction's access/deferrable modes. 2026-04-05 18:55:00 +09:00
deparse.c Add support for importing statistics from remote servers. 2026-04-08 19:15:00 +09:00
Makefile CREATE SUBSCRIPTION ... SERVER. 2026-03-06 08:27:56 -08:00
meson.build CREATE SUBSCRIPTION ... SERVER. 2026-03-06 08:27:56 -08:00
option.c Add support for importing statistics from remote servers. 2026-04-08 19:15:00 +09:00
postgres_fdw--1.0--1.1.sql postgres_fdw: Add functions to discard cached connections. 2021-01-26 15:35:54 +09:00
postgres_fdw--1.0.sql Add postgres_fdw contrib module. 2013-02-21 05:27:16 -05:00
postgres_fdw--1.1--1.2.sql postgres_fdw: Extend postgres_fdw_get_connections to return remote backend PID. 2025-03-03 08:51:30 +09:00
postgres_fdw--1.2--1.3.sql CREATE SUBSCRIPTION ... SERVER. 2026-03-06 08:27:56 -08:00
postgres_fdw.c Add support for importing statistics from remote servers. 2026-04-08 19:15:00 +09:00
postgres_fdw.control CREATE SUBSCRIPTION ... SERVER. 2026-03-06 08:27:56 -08:00
postgres_fdw.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
shippable.c Switch SysCacheIdentifier to a typedef enum 2026-02-18 09:58:38 +09:00