• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate - use index issue

 
Chris Kar
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

We are facing an issue regarding using indexing on a Hibernate query.
The version of the Hibernate is 4.1.9.Final and we connect with MySQL. The application is deployed on Apache Tomcat 7.
We use the Criteria API in order to create the SELECT query on DB.

Our issue is that MySQL does not seem to use the index we have on one of our columns.
So, we would like to force the use of this index by adding on the created query something like:

FROM tableName this_ use index (columnName)


We would be grateful if you could suggest a way to overpass this issue.

Thank you
 
Dave Tolls
Ranch Hand
Posts: 2091
15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you checked your table stats?
It's quite likely that the MySQL engine is correct and the index wouldn't help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic