Re: Slowness of extended protocol

Поиск
Список
Период
Сортировка
От Dave Cramer
Тема Re: Slowness of extended protocol
Дата
Msg-id CADK3HHKW2_FB_yu4L5M-EV6z6aFXSDCPPQLjmuCmFxkeHCYJZQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Slowness of extended protocol  (Shay Rojansky <roji@roji.org>)
Список pgsql-hackers




On 11 August 2016 at 10:18, Shay Rojansky <roji@roji.org> wrote:


On Thu, Aug 11, 2016 at 1:22 PM, Vladimir Sitnikov <sitnikov.vladimir@gmail.com> wrote:

2) The driver can use safepoints and autorollback to the good "right before failure" state in case of a known failure. Here's the implementation: https://github.com/pgjdbc/pgjdbc/pull/477
As far as I can remember, performance overheads are close to zero (no extra roundtrips to create a safepoint)

What? Do you mean you do implicit savepoints and autorollback too? How does the driver decide when to do a savepoint? Is it on every single command? If not, commands can get lost when an error is raised and you automatically roll back? If you do a savepoint on every single command, that surely would impact performance even without extra roundtrips...?

You seem to have a very "unique" idea of what a database driver should do under-the-hood for its users. At the very least I can say that your concept is very far from almost any database driver I've seen up to now (PostgreSQL JDBC, psycopg, Npgsql, libpq...). I'm not aware of other drivers that implicitly prepare statements, and definitely of no drivers that internally create savepoints and roll the back without explicit user APIs. At the very least you should be aware (and also clearly admit!) that you're doing something very different - not necessarily wrong - and not attempt to impose your ideas on everyone as if it's the only true way to write a db driver.


A number of other drivers default to this behaviour, including at least MS-SQL and Oracle. psqlODBC also supports this behaviour with statement rollback mode. And obviously PostgreSQL JDBC which Vladimir is referring to.

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

Предыдущее
От: Vladimir Sitnikov
Дата:
Сообщение: Re: Slowness of extended protocol
Следующее
От: Vladimir Sitnikov
Дата:
Сообщение: Re: handling unconvertible error messages