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

Поиск
Список
Период
Сортировка
От Hitoshi Harada
Тема Re: Function scan push-down using SQL/MED syntax
Дата
Msg-id e08cc0401003080224g183af13dg1dc76ac847cb1d58@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Function scan push-down using SQL/MED syntax  (Takahiro Itagaki <itagaki.takahiro@oss.ntt.co.jp>)
Ответы Re: Function scan push-down using SQL/MED syntax  (Takahiro Itagaki <itagaki.takahiro@oss.ntt.co.jp>)
Список pgsql-cluster-hackers
2010/3/8 Takahiro Itagaki <itagaki.takahiro@oss.ntt.co.jp>:
>
> Takahiro Itagaki <itagaki.takahiro@oss.ntt.co.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.)
>

So, as the first step we implement it by tuplestore with the present
libpq, but for further improvement we need to refactor or to extend
our libpq to buffer some sized tuples. Or invent another
more-data-fetching-oriented protocol like existing copy?

Regards,



--
Hitoshi Harada

В списке pgsql-cluster-hackers по дате отправления:

Предыдущее
От: Brendan Jurd
Дата:
Сообщение: Re: Expanded information template
Следующее
От: Takahiro Itagaki
Дата:
Сообщение: Re: Function scan push-down using SQL/MED syntax