Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YcXtU-0006Uq-PG for pgsql-jdbc@arkaria.postgresql.org; Mon, 30 Mar 2015 11:30:12 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YcXtU-00051w-8e for pgsql-jdbc@arkaria.postgresql.org; Mon, 30 Mar 2015 11:30:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YcXtS-0004zg-VD for pgsql-jdbc@postgresql.org; Mon, 30 Mar 2015 11:30:11 +0000 Received: from mx1.redhat.com ([209.132.183.28]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YcXtI-0002Tk-BZ for pgsql-jdbc@postgresql.org; Mon, 30 Mar 2015 11:30:09 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t2UBTpoe014438 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 30 Mar 2015 07:29:52 -0400 Received: from [10.36.116.64] (ovpn-116-64.ams2.redhat.com [10.36.116.64]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2UBTmAs019122 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 30 Mar 2015 07:29:50 -0400 Message-ID: <551933AC.4050107@redhat.com> Date: Mon, 30 Mar 2015 12:29:48 +0100 From: Jeremy Whiting User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Dave Cramer CC: "pgsql-jdbc@postgresql.org" , magog001@web.de Subject: Re: Resurrected thread: Speed improvement - Group batch Insert - Rewrite the INSERT at the driver level (using a parameter) References: <55130DC8.2070508@redhat.com> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Pg-Spam-Score: -6.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 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