| Thank you Guillaume Smet for your time. I have not set value for hibernate.query.plan_cache_max_size and I am not sure why it is storing more than 2048. We have a homegrown framework that constructs HQLs dynamically. Those 5K queries contain different number of varying parameters. Our organization deals with Sensitive information and Not allowed to share hprof or any other artifacts. Following are some modified sample queries
SELECT e FROM com.XXXX.YYYY.comm.model.XYZBox e WHERE e.uN = ?1 AND e.id = ?2 AND (e.tId IN (?3)) ORDER BY e.cstamp DESC
SELECT e FROM com.XXXX.YYYY.comm.model.XYZBox e WHERE e.uN = ?1 AND e.id = ?2 AND (e.tId IN (?3, ?4)) ORDER BY e.cstamp DESC
In this fashion we may be firing queries with 20-30 tables with different permutations and combinations of parameters. Unfortunately each of them is shoved into that QueryCache plan making things worse  |