Reply: Can we specify transaction level

From: guxiaobo1982 <guxiaobo1982(at)qq(dot)com>
To: bricklen <bricklen(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Reply: Can we specify transaction level
Date: 2013-07-20 02:18:29
Message-ID: tencent_1E43BDBC2E1F1442720212CD@qq.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I wil test next week, but the document of postgres_fdw says it is smart enough to push executing into the external server, I wander is this a bug or a version compability problem.

---原始邮件---
在 2013年07月20日 10:05:02
"bricklen"<bricklen(at)gmail(dot)com> 写道:

On Fri, Jul 19, 2013 at 5:08 PM, guxiaobo1982 <guxiaobo1982(at)qq(dot)com> wrote:
what does a wrapper function mean, count is a standard function in Greenplum, or how to creat the wrapper function.

regards

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?

Create a function in Greenplum like (untested, I don't have Greenplum)

create table custom_count() returns bigint as $$

select count(*) as total from yourtable;

$$ language sql;

Then from your pg db using postgres_fdw select * from that function (which resides in Greenplum).

No idea if that'll work or make a difference though.

Browse pgsql-general by date

  From Date Subject
Next Message Janek Sendrowski 2013-07-20 16:38:10 Index for Levenshtein distance
Previous Message bricklen 2013-07-20 02:05:02 Re: Reply: Can we specify transaction level