Re: [HACKERS] Pipelining executions to postgresql server

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: [HACKERS] Pipelining executions to postgresql server
Дата
Msg-id 5458802E.5010706@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: [HACKERS] Pipelining executions to postgresql server  (Mikko Tiihonen <Mikko.Tiihonen@nitorcreations.com>)
Список pgsql-jdbc
On 11/04/2014 07:56 AM, Mikko Tiihonen wrote:
> I do not quite grasp why not sending Sync is so important.

Well, at the moment the PgJDBC driver relies on the following flow to
manage its buffers and avoid a logjam where both server and client are
waiting for the other to consume input:

* Send some stuff
* Sync
* Consume input until Sync response received

... since at this point it knows the server's send buffer should be
empty, or near enough.

There's no fundamental reason why you *can't* send a Sync after each
query, AFAIK. You just have to change how the driver handles syncs so it
knows that there might be more work pipelined. Or fix the driver's
buffer management, as described in the github issues I linked.

It doesn't make much sense to unless you're running in autocommit mode
though, and I'm not convinced piplelining work in autocommit mode makes
a lot of sense. The biggest problem is exception handling - you can't
throw an exception at some statement execution in the past. So you need
a new interface for piplelining... or to just use the existing batch
interface.

--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: [HACKERS] Pipelining executions to postgresql server
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: [HACKERS] Pipelining executions to postgresql server