Re: Sync vs Flush

Поиск
Список
Период
Сортировка
От Jaka Jančar
Тема Re: Sync vs Flush
Дата
Msg-id CAMUPXmrU-yEJ1CpNweF7gFPcmeXtM8ezvrvNz+_Gg6GFREOwdA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Sync vs Flush  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Makes sense, thanks!

On Thu, Jul 2, 2020 at 15:29 Tom Lane <tgl@sss.pgh.pa.us> wrote:
Jaka Jančar <jaka@kubje.org> writes:
> What is a common situation for using Flush instead of Sync?
> When would you need and wait for the output, get an error, yet still
> proceed to send further messages that you would want the server to ignore?

The only case I can think of offhand is bursting some time-consuming
queries to the server, that is sending this all at once:

   Execute, Flush, Execute, Flush, Execute, Flush, Execute, Sync

This presumes that, if an earlier query fails, you want the rest
to be abandoned; else you'd use Syncs instead.  But if you leave
out the Flushes then you won't see the tail end of (or indeed
maybe none of) the output of an earlier query until a later query
fills the server's output buffer.  So if you're hoping to overlap
the client's processing with the server's you want the extra flushes.

                        regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Use of "long" in incremental sort code
Следующее
От: Joe Conway
Дата:
Сообщение: Re: pg_read_file() with virtual files returns empty string