From c0c6acdfa055b0c76ea0d1defd4c2c0d5a5c256f Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 22 Feb 2013 10:56:06 -0500 Subject: Fix some planning oversights in postgres_fdw. Include eval costs of local conditions in remote-estimate mode, and don't assume the remote eval cost is zero in local-estimate mode. (The best we can do with that at the moment is to assume a seqscan, which may well be wildly pessimistic ... but zero won't do at all.) To get a reasonable local estimate, we need to know the relpages count for the remote rel, so improve the ANALYZE code to fetch that rather than just setting the foreign table's relpages field to zero. --- contrib/postgres_fdw/postgres_fdw.h | 1 + 1 file changed, 1 insertion(+) (limited to 'contrib/postgres_fdw/postgres_fdw.h') diff --git a/contrib/postgres_fdw/postgres_fdw.h b/contrib/postgres_fdw/postgres_fdw.h index 52d1d49b25e..940b81a7398 100644 --- a/contrib/postgres_fdw/postgres_fdw.h +++ b/contrib/postgres_fdw/postgres_fdw.h @@ -47,6 +47,7 @@ extern void appendWhereClause(StringInfo buf, bool has_where, List *exprs, PlannerInfo *root); +extern void deparseAnalyzeSizeSql(StringInfo buf, Relation rel); extern void deparseAnalyzeSql(StringInfo buf, Relation rel); #endif /* POSTGRES_FDW_H */ -- cgit v1.2.3