hibernate-reactive icon indicating copy to clipboard operation
hibernate-reactive copied to clipboard

log usage of statement batching

Open gavinking opened this issue 4 years ago • 3 comments

@Sanne thinks there might be a problem with batch inserts/updates not happening efficiently, and it would help to log some information to help diagnose this.

gavinking avatar Aug 25 '21 10:08 gavinking

@Sanne I'm ready to work on this, but can you give me a bit of a better idea of exactly what sort of log messages would help here? Thanks.

gavinking avatar Aug 30 '21 07:08 gavinking

@Sanne, any detail you can add to this issue?

DavideD avatar Feb 24 '22 17:02 DavideD

Sorry I missed the previous notifications.

And to be clear this might need to be addressed in ORM core first. The main problem is that there are circumstances in which possibly

  1. ORM will automatically batch things
  2. or the opposite case, the user explicitly expects it to batch things but ORM can't and will fallback to not doing it

But it's actually hard for the user to figure out if batching is being applied effectively. I often see reports from people that enable logging of statements and then complain that batching is not effective, but this is just a side effect of how we log things: even with batching enabled, each statement is logged individually - hence it's actually not possible from examining logs to determine if batching actually was performed.

A first improvement could be to ensure a batch is logged "as a batch"; I'd also like if it could generate an event to be captured with JFR - but that's beyond initial scope as we don't have any JFR events yet.

Sanne avatar Feb 24 '22 20:02 Sanne