pgsql: Fix some planning oversights in postgres_fdw.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix some planning oversights in postgres_fdw.
Date: 2013-02-22 15:56:54
Message-ID: E1U8uzW-0001gQ-1c@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/c0c6acdfa055b0c76ea0d1defd4c2c0d5a5c256f

Modified Files
--------------
contrib/postgres_fdw/deparse.c | 23 +++++++++
contrib/postgres_fdw/postgres_fdw.c | 87 ++++++++++++++++++++++++++++++++---
contrib/postgres_fdw/postgres_fdw.h | 1 +
3 files changed, 104 insertions(+), 7 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2013-02-22 19:58:14 pgsql: Add pg_xlogdump contrib program
Previous Message Andres Freund 2013-02-22 15:38:28 Re: pgsql: Blind attempt at fixing the non-MSVC Windows builds