1

Is there any libraries available that can be used to optimize hibernate queries?

I have tried searching for it, but what I found was the ways in which we could optimize sql queries.

2 Answers 2

2

When it comes to JPA and Hibernate, you have to make sure the auto-generated SQL query is as efficient as the one you'd write using plain JDBC.

All in all, you have to analyze the SQL query execution plan and tune the query accordingly.

Now, there are all sorts of tools to help you with this task, like pt-query-advisor for MySQL.

Another option is to use Hypersistence Optimizer, which allows you to optimize your JPA and Hibernate mappings and configurations so that the auto-generated SQL queries are more efficient.

Sign up to request clarification or add additional context in comments.

Comments

1

Hibernate optimizes queries itself, you need to fine-tune them by using caching and so on. Of course the most basic thing you can do is to log the sql queries and optimize them. You can also use something to manage your db connection, for example flexy-pool.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.