New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite batch update into "update from" query #888
Comments
You want to open this can of worms ???? |
Why not? =) PS. This batch seems to be common in ORMs, so it might be a great win. |
It looks like UPDATE ... FROM (VALUES...) makes sense (see (batch_sort-get_worlds) vs (update_from_values-get_worlds)) see pgjdbc#888 see TechEmpower/FrameworkBenchmarks#2684
It looks like UPDATE ... FROM (VALUES...) makes sense (see (batch_sort-get_worlds) vs (update_from_values-get_worlds)) see pgjdbc/pgjdbc#888 see TechEmpower/FrameworkBenchmarks#2684
I'm using the Hibernate ORM and it doesn't write actual insert on update batched statements (with multiple I would really love if there was a similar feature for Which is to say a feature to rewrite consecutive statements :
into a single statement:
@davecramer Initially, regarding this feature request you said a few years ago :
Do you have any insights to share like a simple counter example where it would not be generally possible to implement such a feature reliably ? I'm trying to understand what would be the major pain points if there are any. Thanks a lot ! |
@idkw seems doable with the example above. Nobody has found any cycles to do it. |
For instance, TechEmpower has special case for batch update.
The query is as follows (see https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/Java/servlet/src/main/java/hello/PostgresUpdateServlet.java#L26 ):
The query is executed in a batch like
It might be a nice (crazy?) idea to rewrite the query as follows:
That would reduce the number of wire messages, and improve the performance of the batch update.
The text was updated successfully, but these errors were encountered: