Performance Tuning - Number of database calls
Clash Royale CLAN TAG#URR8PPP
Performance Tuning - Number of database calls
In our codebase, we have several database queries which we think are not optimized. But before starting optimizations we want to analyse how many calls our code base (java) performing in specific set of operation.
Is there any way or tool, which can provide me that information. For example,
we have page1 which when we hit, query the database. Statements are written like select * from ( select * from (select * from..........
select * from ( select * from (select * from..........
We need the count only.
Thanks,
2 Answers
2
I really like the integrated profiler in Netbeans. If you turn on methods-profiling, you get a estimated rough amount of how many calls are made and how long they took. Take a look here for a guide how to use it: link
Can you please help me to understand which type of java application are you running are you using spring? and which orm (hibernate , mybatis or spring jdbc) are you using?
For now you can try below options and monitor the logs
Hibernate:
logging.level.org.hibernate.SQL=DEBUG
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
MyBatis
log4j.logger.yourmapperpackage=DEBUG
Spring JDBC:
<category name="org.springframework.jdbc.core.JdbcTemplate">
<priority value="debug" />
</category>
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.