pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gavin Flower <GavinFlower@archidevsys.co.nz>
To: Sehrope Sarkuni <sehrope@jackdb.com>
To: List <pgsql-jdbc@postgresql.org>
Subject: Re: Speed up JDBC connection creation on 9.0+
Date: Sat, 19 Apr 2014 11:56:21 +1200
Message-ID: <5351BBA5.7010108@archidevsys.co.nz> (raw)
In-Reply-To: <CAH7T-arP9+Gq8OHMkkAA4Mkh-+7QS+LbXT0OweghCpi5_ZQxHg@mail.gmail.com>
References: <CAH7T-arP9+Gq8OHMkkAA4Mkh-+7QS+LbXT0OweghCpi5_ZQxHg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

On 19/04/14 11:28, Sehrope Sarkuni wrote:
> I submitted a pull request[1] that speeds up connection creation when
> connection to a 9.0+ database. The idea is that if you instruct the
> driver in advance that the remote server is 9.0+ then it can send the
> "application_data" and "extra_float_digits" parameters as part of the
> StartupMessage rather than in separate "SET ..." statements
> afterwards. This saves a couple of round trips when creating a new
> JDBC connection.
>
> It probably won't make much difference for most people as if you're
> using a connection pool the startup cost only happens once but it does
> help a little bit.
>
> For lack of a better name I've called the new boolean connection
> property "isModernServer". Feel free to suggest a better name.
>
> Thinking about it a bit more, if 8.4 is going to be EOL this year then
> would it make more sense to skip this idea and just wait till it's
> gone?
>
> At that point we could have newer versions the JDBC driver (say a 9.4
> release) assume the remote server is 9.0+ and not even bother with the
> additional connection property.
>
> We could even do the reverse and have a property instruct the driver
> that the server is <9.0 so it doesn't send the application_name
> property in the StartupMessage. Anyone upgrading to the latest driver
> but using an older (EOLed) database would have to add the extra
> property for compatibility but everybody else using 9.0+ servers would
> get the faster startup without any config changes.
>
> If that's acceptable then I think it's a better approach.
>
> [1]: https://github.com/pgjdbc/pgjdbc/pull/144
>
> Regards,
> -- Sehrope Sarkuni
> Founder & CEO | JackDB, Inc. | http://www.jackdb.com/
>
>
What happens when we get an even more Modern Server?

How about 'is9.0PlusServer', or something like it?


Cheers,
Gavin


-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



view thread (4+ messages)  latest in thread

Message-ID: <5351BBA5.7010108@archidevsys.co.nz>
Permalink:  ../5351BBA5.7010108@archidevsys.co.nz/
Also on:    postgresql.org/message-id/5351BBA5.7010108@archidevsys.co.nz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: GavinFlower@archidevsys.co.nz, sehrope@jackdb.com
  Subject: Re: Speed up JDBC connection creation on 9.0+
  In-Reply-To: <5351BBA5.7010108@archidevsys.co.nz>
  References: <CAH7T-arP9+Gq8OHMkkAA4Mkh-+7QS+LbXT0OweghCpi5_ZQxHg@mail.gmail.com> <5351BBA5.7010108@archidevsys.co.nz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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