Re: Statement-level rollback

From: Vladimir Sitnikov <sitnikov(dot)vladimir(at)gmail(dot)com>
To: "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, MauMau <maumau307(at)gmail(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Statement-level rollback
Date: 2017-11-02 05:59:31
Message-ID: CAB=Je-E3jTFic3BBMWqbrEAP+TwrE=jN8F-ko5x7+cGZkaiqJg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-jdbc

Tsunakawa> PgJDBC has supported the feature with autosave parameter only
recently

PgJDBC has the implementation for more than a year (REL9.4.1210,
2016-09-07, see https://github.com/pgjdbc/pgjdbc/pull/477 )

Tsunakawa> The point raised in this thread was that that creates
Tsunakawa> too much network overhead, so a backend-based solution would be
preferable.
Tsunakawa> We haven't seen any numbers or other evidence to quantify that
claim, so
Tsunakawa> maybe it's worth looking into that some more

The performance overhead for "SELECT" statement (no columns, just select)
statement over localhost is 36±4 us vs 38±3 us (savepoint is pipelined
along with user-provided query). That is network overhead is close to
negligible.

As far as I understand, the main problem with savepoints is they would
consume memory even in case the same savepoint is reassigned again and
again.
In other words, "savepoint; insert;savepoint; insert;savepoint;
insert;savepoint; insert;savepoint; insert;" would allocate xids and might
blow up backend's memory.
I see no way driver can workaround that, so it would be great if backend
could release memory or provide a way to do so.

Adding protocol messages would blow pgbouncer, etc things, so it makes
sense to refrain from new messages unless it is absolutely required.

Vladimir

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Satyanarayana Narlapuram 2017-11-02 06:02:43 Client Connection redirection support for PostgreSQL
Previous Message Catalin Iacob 2017-11-02 05:56:54 Re: Patch: add --if-exists to pg_recvlogical

Browse pgsql-jdbc by date

  From Date Subject
Next Message Craig Ringer 2017-11-02 06:16:26 Re: Statement-level rollback
Previous Message Tsunakawa, Takayuki 2017-11-02 05:42:44 Re: Statement-level rollback