Reputation: 556
I have a Spring Batch application packaged as a JAR file as highlighted below
java -Xms2048m -Xmx2048m -Ddivision=25 -Ddate= -Denv=dv -Dconn=45 -jar demo-jobs*.jar job-definition.xml jobName -next
I want to optimize the overall execution time, so I'm trying to trace the average execution time for all the methods. I am using Java Flight Recorder.
I see that the following Hibernate methods taking high execution percentage
What does it mean? How do I optimize this?
Upvotes: 0
Views: 520
Reputation: 8836
This means that a lot of time is spent running SQL queries, which is often the case on a typical CRUD application.
Query.getResultList()
relates to select
queries, and SessionImpl.executeUpdate()
relates to update
or delete
queries.
In order to understand what's happening, you'll have to find which queries are executed. There are many ways to do this, but my two favorites are:
Once you have the detail of all the SQL queries that were executed, you'll have to check if it's consistent with what your application should do.
Problems that could occur:
where
clauses (note that foreign keys are not automatically indexed on some databases)Upvotes: 2