简体   繁体   中英

How to improve search performance in web application using Hiberante framework with MySql Database

I'm developing web application using Hiberante ORM tool and MySql database and i'm trying to search data from multiple tables among 2 lacks of data its taking longer time to search data, so please any one suggest me to improve performance of search (using Hibernate ORM tool and MySql DB) or should i use any searching functionality for it.

Thanking You All

To start with, log the generated SQL queries using the option:

<property name="show_sql">true</property>

Viewing the SQL you can detect if there are unnecessary joins, or unnecessary loads data. Then, modify your mapping or the way that you build your queries.

Maybe, you'll face the classic N+1 query problem

  1. Add indexes;
  2. Replace FetchType.EAGER by FetchType.LAZY.

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