Re: executeBatch() issue with new driver?
От | Alan Stange |
---|---|
Тема | Re: executeBatch() issue with new driver? |
Дата | |
Msg-id | 4187F1B8.1010302@rentec.com обсуждение исходный текст |
Ответ на | Re: executeBatch() issue with new driver? (Kris Jurka <books@ejurka.com>) |
Ответы |
Re: executeBatch() issue with new driver?
|
Список | pgsql-jdbc |
Kris Jurka wrote: >On Tue, 2 Nov 2004, Alan Stange wrote: > > > >>>The real problem is that executeBatch() returns an int[] of update counts. >>> >>> >>> >>This was what I was thinking. What does the pg74 driver do in this >>case as it does allow multiple statements in each batch? >> >> >> > >The 8.0 driver uses the extended query protocol while the 7.4 driver >uses the simple query protocol. The relevent difference in this case is >that you can only send one command per query in the extended query >protocol while you can string them together with ";" in the simple case. >This means the 8.0 driver splits the queries and issues them individually >and gets update counts for each command. The 7.4 driver issues them >together and only gets one update count (for the last piece of the batch). > > > >>Network latency. We were able to greatly increase performance this way >>by reducing the number of round trips. >> >> >> > >Well in the 8.0 case you've lost that anyway because it splits them and >issues them separately. Although the 8.0 driver does have some other >advantages in that it doesn't issue a Sync after each individual query, >but sends out a number of commands and then processes a number of results, >so the number of round trips will be reduced, but in a different fashion. > > What about this case: Connection conn = ... Statement st = conn.createStatement(); st.execute("insert a; insert b; insert c; insert d;"); Is the 8.0 driver busting this up into 4 trips to the database?! -- Alan
В списке pgsql-jdbc по дате отправления: