Re: return next

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: return next
Дата
Msg-id 18533.1131721036@sss.pgh.pa.us
обсуждение исходный текст
Ответ на return next  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-general
Jeff Davis <pgsql@j-davis.com> writes:
> From the docs on plperl:
> "Usually you'll want to return rows one at a time, both to speed up
> startup time and to keep from queueing up the entire result set in
> memory. You can do this with return_next as illustrated below."

> Am I misunderstanding the docs? How do I just return one tuple at a time
> without PostgreSQL continuing the loop?

The docs are perhaps a little misleading.  The perl function will
execute to completion in any case --- it's hard to see how to prevent
that from happening without breaking perl.  The point of the comment
is that with return_next, buffering of the result set happens in a
TupleStore object (which knows how to spill an oversize set to disk)
rather than inside perl (which doesn't).

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Best way to use indexes for partial match at
Следующее
От: Andrew Schmidt
Дата:
Сообщение: Re: Two slightly different queries produce same results,