Performance degradation of Criteria API queries with cached results in Hibernate 6.x and 7.x versions

Hi, Christian

Thanks for implementing this caching in the 7.2 version.
When I was debugging the Hibernate code, I have found a property

hibernate.criteria.plan_cache_enabled

which is responsible for the Criteria query plan cache. It is false by default.
When I enabled it, I have got the same performance difference 50% with 5.6.x version as I had for the JPQL query.
Which is much better than 200% that I had before.
It will be great to have this property in the 7.0 Migration Guide, too.

But the issue with “ilter enabled”, which disables caching, is still there for us.

Is there any chance that this behavior will change in the future?

Thanks