Hi,
I got some questions about the intelligence of the caching in Hibernate.
Scenario:
The following example is used as foundation to my questions:
a) Query A contains criteria on attribute A
b) Query B contains criteria on attribute A and B
c) Query C contains criteria on attributes A, B, and C.
Now imagine queries A, B and C are executed in this order (query- and 2nd-level cache are enabled)
Questions:
a) when executing query B, I would expect an intelligent query cache to do the following:
- recognize that the query can be subdivided into 2 subqueries, one with criteria on A, one with criteria on B.
- since query A is already in the cache, just apply criteria B on the cached query results.
b) when executing query C, I would expext an intelligent query cache to do the following:
- recognize that the query can be subdivided into 3 subqueries, one with criteria on A, one with criteria on B, and one with criteria on C.
- since query B already regroups A and B, just apply criteria on C to the cached query results from query B.
c) I think you get the idea. How intelligent is Hibernate's query cache in conjunction with the second level cache working ? I would really like to know more about that topic, but neither in the Hibernate book, neither in the documentation do I find much detail about this.
Kind regards,
Jay Zawar
|