Re: Resurrected thread: Speed improvement - Group batch Insert - Rewrite the INSERT at the driver level (using a parameter)

Поиск
Список
Период
Сортировка
От Dave Cramer
Тема Re: Resurrected thread: Speed improvement - Group batch Insert - Rewrite the INSERT at the driver level (using a parameter)
Дата
Msg-id CADK3HHLD+6hUa5sJg=JwfH_8AmjgQK0ZehyUZkeYUDQgAc3E2w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Resurrected thread: Speed improvement - Group batch Insert - Rewrite the INSERT at the driver level (using a parameter)  (Jeremy Whiting <jwhiting@redhat.com>)
Список pgsql-jdbc


Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca

On 30 March 2015 at 07:29, Jeremy Whiting <jwhiting@redhat.com> wrote:
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 ;)

As a matter of fact query parsing has been avoided outright. We do not want to parse the query. This will have a fairly high barrier to entry, as you are now going to slow every query down.
 
 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.

Comparing PostgreSQL to MySQL even at the driver level would be hard to prove where the efficiency would be realized. How can you prove whether the problem is the driver or the backend, or even the network ? 

Can you provide references to said users ?

 

 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

Look forward to seeing it.
 


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


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Jeremy Whiting
Дата:
Сообщение: Re: Resurrected thread: Speed improvement - Group batch Insert - Rewrite the INSERT at the driver level (using a parameter)
Следующее
От: Thomas Kellerer
Дата:
Сообщение: Re: Resurrected thread: Speed improvement - Group batch Insert - Rewrite the INSERT at the driver level (using a parameter)