pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedv2 protocol: is it still used?
4+ messages / 2 participants
[nested] [flat]
* v2 protocol: is it still used?
@ 2016-08-05 09:39 Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Vladimir Sitnikov @ 2016-08-05 09:39 UTC (permalink / raw)
To: pgsql-jdbc
Hi,
Does anybody still use v2 protocol via pgjdbc?
I'm reworking QueryExecutor/ProcotolConnection implementation as a part of
"smarter returning" (https://github.com/pgjdbc/pgjdbc/issues/488), and I
would like to just drop v2 support.
As far as I know, v3 was introduced in PostgreSQL 7.4, thus it looks rather
safe to just drop v2 support in pjgdbc.
By the way, the oldest version we test in Travis is 8.4
Vladimir
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: v2 protocol: is it still used?
@ 2016-08-05 10:04 Guillaume Cottenceau <gc@mnc.ch>
parent: Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Guillaume Cottenceau @ 2016-08-05 10:04 UTC (permalink / raw)
To: Vladimir Sitnikov <sitnikov.vladimir@gmail.com>; +Cc: pgsql-jdbc
Hi,
A few years back, I analysed the reason why some JDBC requests
were slower than psql requests. It turned out that, by using
prepared statement in protocol v3, the query plan is determined
once and for all (IIRC, for a given PreparedStatement object),
and so when reused later with other query parameters (typically,
not as selective, I guess), it turned out to be much slower
(suboptimal query plan). The only workaround I found back then,
was to use protocol v2 (IIRC prepared statements are fully client
side in protocol v2?). I noticed recently though that it's not
going to be able anymore soon, because the 9.5 backend breaks on
the driver passing autocommit=true anyways.
Thanks
> Hi,
>
> Does anybody still use v2 protocol via pgjdbc?
>
> I'm reworking QueryExecutor/ProcotolConnection implementation as a part of
> "smarter returning" (https://github.com/pgjdbc/pgjdbc/issues/488), and I would
> like to just drop v2 support.
>
> As far as I know, v3 was introduced in PostgreSQL 7.4, thus it looks rather
> safe to just drop v2 support in pjgdbc.
>
> By the way, the oldest version we test in Travis is 8.4
>
> Vladimir
--
Guillaume Cottenceau
--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: v2 protocol: is it still used?
@ 2016-08-05 13:41 Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
parent: Guillaume Cottenceau <gc@mnc.ch>
0 siblings, 1 reply; 4+ messages in thread
From: Vladimir Sitnikov @ 2016-08-05 13:41 UTC (permalink / raw)
To: Guillaume Cottenceau <gc@mnc.ch>; +Cc: pgsql-jdbc
Guillaume Cottenceau <gc@mnc.ch>:
> The only workaround I found back then,
> was to use protocol v2 (IIRC prepared statements are fully client
> side in protocol v2?). I noticed recently though that it's not
> going to be able anymore soon, because the 9.5 backend breaks on
> the driver passing autocommit=true anyways.
>
Workarounds exist for v3 as well: for instance, completely disable usage of
server-prepared statements.
Alternatively, we could even implement "use server-prepared statement at
most 5 times" (so the backend never switches to a generic plan).
I wonder what would be the best way to handle current
protocolVersion=2 installations:
1) ignore protocolVersion=2 and just use v3
2) throw exception "A connection could not be made using the requested
protocol 2"
Even though #1 might not be that expected, however I believe it will
provide smooth migration to never pgjdbc versions without "manual
configuration changes here and there"
Vladimir
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: v2 protocol: is it still used?
@ 2016-08-05 13:53 Guillaume Cottenceau <gc@mnc.ch>
parent: Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
0 siblings, 0 replies; 4+ messages in thread
From: Guillaume Cottenceau @ 2016-08-05 13:53 UTC (permalink / raw)
To: Vladimir Sitnikov <sitnikov.vladimir@gmail.com>; +Cc: pgsql-jdbc
Vladimir Sitnikov <sitnikov.vladimir 'at' gmail.com> writes:
> Guillaume Cottenceau <gc@mnc.ch>:
>
> The only workaround I found back then,
> was to use protocol v2 (IIRC prepared statements are fully client
> side in protocol v2?). I noticed recently though that it's not
> going to be able anymore soon, because the 9.5 backend breaks on
> the driver passing autocommit=true anyways.
>
>
> Workarounds exist for v3 as well: for instance, completely disable usage of
> server-prepared statements.
> Alternatively, we could even implement "use server-prepared statement at most 5
> times" (so the backend never switches to a generic plan).
Thanks for the hints!
> I wonder what would be the best way to handle current protocolVersion=
> 2 installations:
> 1) ignore protocolVersion=2 and just use v3
> 2) throw exception "A connection could not be made using the requested protocol
> 2"
>
> Even though #1 might not be that expected, however I believe it will provide
> smooth migration to never pgjdbc versions without "manual configuration changes
> here and there"
I humbly think #2 is more reliable and clear.
--
Guillaume Cottenceau
--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2016-08-05 13:53 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-08-05 09:39 v2 protocol: is it still used? Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
2016-08-05 10:04 ` Guillaume Cottenceau <gc@mnc.ch>
2016-08-05 13:41 ` Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
2016-08-05 13:53 ` Guillaume Cottenceau <gc@mnc.ch>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox