简体   繁体   中英

Hibernate query optimization library

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.

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.

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM