Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WbIe7-0002C3-3o for pgsql-jdbc@arkaria.postgresql.org; Fri, 18 Apr 2014 23:56:39 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WbIe6-0002yA-Hb for pgsql-jdbc@arkaria.postgresql.org; Fri, 18 Apr 2014 23:56:38 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WbIe5-0002y3-I1 for pgsql-jdbc@postgresql.org; Fri, 18 Apr 2014 23:56:37 +0000 Received: from mbx.knossos.net.nz ([202.160.48.10]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WbIdy-0003vA-Pt for pgsql-jdbc@postgresql.org; Fri, 18 Apr 2014 23:56:36 +0000 Received: from [10.1.1.3] (121-99-178-58.bng1.nct.orcon.net.nz [121.99.178.58]) (authenticated bits=0) by mbx.knossos.net.nz (8.14.4/8.14.4) with ESMTP id s3INuLab003674 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sat, 19 Apr 2014 11:56:22 +1200 Message-ID: <5351BBA5.7010108@archidevsys.co.nz> Date: Sat, 19 Apr 2014 11:56:21 +1200 From: Gavin Flower Organization: ArchiDevSys User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Sehrope Sarkuni , List Subject: Re: Speed up JDBC connection creation on 9.0+ References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org 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