postgresql/contrib/postgres_fdw
Tomas Vondra 8ad51b5f44 Sample postgres_fdw tables remotely during ANALYZE
When collecting ANALYZE sample on foreign tables, postgres_fdw fetched
all rows and performed the sampling locally. For large tables this means
transferring and immediately discarding large amounts of data.

This commit allows the sampling to be performed on the remote server,
transferring only the much smaller sample. The sampling is performed
using the built-in TABLESAMPLE methods (system, bernoulli) or random()
function, depending on the remote server version.

Remote sampling can be enabled by analyze_sampling on the foreign server
and/or foreign table, with supported values 'off', 'auto', 'system',
'bernoulli' and 'random'. The default value is 'auto' which uses either
'bernoulli' (TABLESAMPLE method) or 'random' (for remote servers without
TABLESAMPLE support).
2022-12-30 23:16:01 +01:00
..
expected Sample postgres_fdw tables remotely during ANALYZE 2022-12-30 23:16:01 +01:00
sql Sample postgres_fdw tables remotely during ANALYZE 2022-12-30 23:16:01 +01:00
.gitignore
connection.c Rename SetSingleFuncCall() to InitMaterializedSRF() 2022-10-18 10:22:35 +09:00
deparse.c Sample postgres_fdw tables remotely during ANALYZE 2022-12-30 23:16:01 +01:00
Makefile postgres_fdw: Add function to list cached connections to foreign servers. 2021-01-18 15:11:08 +09:00
meson.build Add copyright notices to meson files 2022-12-20 07:54:39 -05:00
option.c Sample postgres_fdw tables remotely during ANALYZE 2022-12-30 23:16:01 +01: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
postgres_fdw.c Sample postgres_fdw tables remotely during ANALYZE 2022-12-30 23:16:01 +01:00
postgres_fdw.control postgres_fdw: Add function to list cached connections to foreign servers. 2021-01-18 15:11:08 +09:00
postgres_fdw.h Sample postgres_fdw tables remotely during ANALYZE 2022-12-30 23:16:01 +01:00
shippable.c Update copyright for 2022 2022-01-07 19:04:57 -05:00