Re: Function scan push-down using SQL/MED syntax

From: Takahiro Itagaki <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
Cc: pgsql-cluster-hackers(at)postgresql(dot)org
Subject: Re: Function scan push-down using SQL/MED syntax
Date: 2010-03-08 01:01:27
Message-ID: 20100308100126.9C43.52131E4D@oss.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-cluster-hackers


Takahiro Itagaki <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp> wrote:

> > * I'm not very happy with "Getting tuples from the foreign server"
> > section. Present tuplestore isn't quite efficient and putting all
> > tuples into TSS adds devastating overhead. In principle, storing
> > tuples doesn't match SQL exectuor model. So something like cursor is
> > needed here.
>
> Sure, but your optimization requires some extensions in libpq protocol.
> We could send HeapTuple in a binary form if the remote and the local
> server uses the same format, but the present libpq can return tuples
> only as text or libpq-specific binary forms (that is not a HeapTuple).

In addition, I beleive the tuplestore is requried *for performance*
because per-tuple cursor fetching is very slow if we retrieve tuples from
remote servers. We should fetch tuples in some resonable-size of batches.

If we will optimize the part, we could remove PGresult-to-tuplestore
convertson here. But we also need to some codes to avoid memory leak
of PGresult on error because PGresult is allocaed with malloc, not palloc.
(That is the same bug in contrib/dblink fixed recently.)

Regards,
---
Takahiro Itagaki
NTT Open Source Software Center

In response to

Responses

Browse pgsql-cluster-hackers by date

  From Date Subject
Next Message Fujii Masao 2010-03-08 01:27:18 Re: pgCluster page up ...
Previous Message Takahiro Itagaki 2010-03-08 00:44:21 Re: Function scan push-down using SQL/MED syntax