Re: Reply: Can we specify transaction level when connectting toexternal postgresql server via postgres_fdw

From: bricklen <bricklen(at)gmail(dot)com>
To: guxiaobo1982 <guxiaobo1982(at)qq(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Reply: Can we specify transaction level when connectting toexternal postgresql server via postgres_fdw
Date: 2013-07-19 22:20:12
Message-ID: CAGrpgQ9NM9AQYrFryh_NSZhRPXMDGwWRBwM4z0h1W1EhjEJnJQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Jul 19, 2013 at 7:47 AM, guxiaobo1982 <guxiaobo1982(at)qq(dot)com> wrote:

> There is another situation,
>
> We have a demo table with about 17000000 rows, the "select count(1) from
> demotable" statement finishes with-in 3 seconds when executed directlly
> against the Greenplum database,but it takes about 230 seconds to finish
> when executed via postgres_fdw inside PostgreSQL 9.3 beta2, I guess that it
> may because of postgres_fdw pulling data to the PostgreSQL instance and
> counts the rows there, but I think the query optimizer should pass through
> the count() function to the Greenplum end, and gets only the result back.
>

Are you able to create a function in Greenplum which is a wrapper around
that count(*) and call that via the postgres_fdw?

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Natalie Wenz 2013-07-19 22:20:13 Insert result does not match record count
Previous Message Tim Kane 2013-07-19 15:21:30 Re: Hot Standby and Foreign Tables