• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Hibernate - use index issue

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic