Re: Is the PL/pgSQL refcursor useful in a modern three-tier app?

Поиск
Список
Период
Сортировка
От Dominique Devienne
Тема Re: Is the PL/pgSQL refcursor useful in a modern three-tier app?
Дата
Msg-id CAFCRh-9B8mf6tJrGziis7SfSzYyOiXgsk-_abOVc8FMm5e-75Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Is the PL/pgSQL refcursor useful in a modern three-tier app?  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: Is the PL/pgSQL refcursor useful in a modern three-tier app?  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-general
On Thu, Mar 16, 2023 at 9:23 AM Pavel Stehule <pavel.stehule@gmail.com> wrote:
čt 16. 3. 2023 v 9:18 odesílatel Dominique Devienne <ddevienne@gmail.com> napsal:
[...] depends on what you value in a particular situation, latency or throughput. --DD

cursors are optimized for minimal cost of first row, queries are optimized for minimal cost of last row

That's a nice way to put it Pavel.

And to have it both ways, use COPY in binary protocol? That way the rows are streamed
to you in arbitrary chunks as soon as available (I hope), and the burden is on you the
client to decode and use those rows in parallel as they are "streamed" to you.

I've yet to test that (thus the 'i hope' above). I used COPY binary for INSERTs,
and COPY text/json for SELECTs, not yet COPY binary for SELECTs. I'm hoping
the latency of COPY will be small compared to a regular SELECT where I have to
wait for LIBPQ to assemble the whole ResultSet. Are my hopes unfounded? --DD

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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: Is the PL/pgSQL refcursor useful in a modern three-tier app?
Следующее
От: Daniel Gustafsson
Дата:
Сообщение: Re: pg_upgrade Only the install user can be defined in the new cluster