Re: [patch] libpq one-row-at-a-time API

Поиск
Список
Период
Сортировка
От Jan Wieck
Тема Re: [patch] libpq one-row-at-a-time API
Дата
Msg-id 50173BF7.1070801@Yahoo.com
обсуждение исходный текст
Ответ на Re: [patch] libpq one-row-at-a-time API  (Leon Smith <leon.p.smith@gmail.com>)
Ответы Re: [patch] libpq one-row-at-a-time API  (Leon Smith <leon.p.smith@gmail.com>)
Список pgsql-hackers
On 7/30/2012 8:11 PM, Leon Smith wrote:
> One other possibility,  Tom Lane fretted ever so slightly about the use
> of malloc/free per row... what about instead of PQsetSingleRowMode,  you
> have PQsetChunkedRowMode that takes a chunkSize parameter.   A chunkSize
> <= 0 would be equivalent to what we have today,   a chunkSize of 1 means
> you get what you have from PQsetSingleRowMode,  and larger chunkSizes
> would wait until n rows have been received before returning them all in
> a single result.      I don't know that this suggestion is all that
> important, but it seems like an obvious generalization that might
> possibly be useful.

It is questionable if that actually adds any useful functionality. Any 
"collecting" of multiple rows will only run the risk to stall receiving 
the following rows while processing this batch. Processing each row as 
soon as it is available will ensure making most use network buffers.

Collecting multiple rows, like in the FETCH command for cursors does, 
makes sense when each batch introduces a network round trip, like for 
the FETCH command. But does it make any sense for a true streaming mode, 
like what is discussed here?


Jan

-- 
Anyone who trades liberty for security deserves neither
liberty nor security. -- Benjamin Franklin


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

Предыдущее
От: Leon Smith
Дата:
Сообщение: Re: [patch] libpq one-row-at-a-time API
Следующее
От: Leon Smith
Дата:
Сообщение: Re: [patch] libpq one-row-at-a-time API