pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeremy Whiting <jwhiting@redhat.com>
To: Dave Cramer <pg@fastcrypt.com>
Cc: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>
Cc: magog001@web.de
Subject: Re: Resurrected thread: Speed improvement - Group batch Insert - Rewrite the INSERT at the driver level (using a parameter)
Date: Mon, 30 Mar 2015 12:29:48 +0100
Message-ID: <551933AC.4050107@redhat.com> (raw)
In-Reply-To: <CADK3HHK+aKbwOiBqsyhneaviVCiwf8sWvoysYHS8-cW9OcA28A@mail.gmail.com>
References: <55130DC8.2070508@redhat.com>
	<CADK3HHK+aKbwOiBqsyhneaviVCiwf8sWvoysYHS8-cW9OcA28A@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

Hi Dave,
  Yes I noticed query parsing doesn't occur in the code base. I do hope 
avoiding query parsing is not going to be avoided outright ;)
  I suggest an optimization like this should be enabled only through 
configuration. Using a connection parameter. So the default driver 
behaviour will continue to avoid query parsing.

  I agree the small batch size is a meagre improvement. Putting on my 
red hat I have customers and community users seeking any improvement 
possible using batching. They see the optimization in the MySQL jdbc 
driver and want to have some of that too as they are using 
PostgreSQL/EnterpriseDB and do not have the option to change.


  Having investigated this optimization and the issues in Git there is a 
particular case I wish to avoid/de-scope. That is INSERT statements with 
RETURNING. I see there are a number of open issues that Craig Ringer is 
investigating.

  At the moment I am coding changes to the driver [3] with the intention 
of proposing they be added. Along with test cases to add coverage for 
existing default behaviour and expected behaviour when the optimization 
is enabled.

Jeremy

[3] https://github.com/whitingjr/pgjdbc/tree/batched-insert-rewrite

On 28/03/15 18:01, Dave Cramer wrote:
> Hi Jeremy,
>
> As Oliver pointed out in the response to [1] this would require 
> parsing the query which we avoid.
>
> I also note that this approach isn't much of an improvement for small 
> batches. I am curious what is your real world use case that prompted 
> this experiment ?
>
> Dave
>
> Dave Cramer
>
> dave.cramer(at)credativ(dot)ca
> http://www.credativ.ca



-- 
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 (7+ messages)  latest in thread

Message-ID: <551933AC.4050107@redhat.com>
Permalink:  ../551933AC.4050107@redhat.com/
Also on:    postgresql.org/message-id/551933AC.4050107@redhat.com

 · 

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: jwhiting@redhat.com, pg@fastcrypt.com, magog001@web.de
  Subject: Re: Resurrected thread: Speed improvement - Group batch Insert - Rewrite the INSERT at the driver level (using a parameter)
  In-Reply-To: <551933AC.4050107@redhat.com>
  References: <55130DC8.2070508@redhat.com> <CADK3HHK+aKbwOiBqsyhneaviVCiwf8sWvoysYHS8-cW9OcA28A@mail.gmail.com> <551933AC.4050107@redhat.com>

* 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