Aaron wrote:
Hibernate is spending 95% of it's time performing a very simple query, which selects * from a single table based on 3 columns.
Is the problem that the query is slow or Hibernate is running it too often?
I would first run an explain on the sql to verify the execution plan is using an index. Adding an index may dramatically improve your response time.
Once you are sure the sql is running optimally, I would look at why Hibernate is running it.
What in the program is causing Hibernate to run the select?
Could you add a integer column to the table (and use the <version> column mapping) to act as a version number? This would make it much easier for Hibernate to tell if the entity has changed.
Regards.