Vlad Mihalcea suggested of logging a ticket for this [SO|http://stackoverflow.com/questions/40257688/hibernate-querytranslatorimpl-hql-ast-parsing-performance #comment67816046_40260896 ]
If've noticed, the QueryPlanCache was not used, if executing Spring-data -jpa findAll method with an EntityGraph annotation.
I've added the EntityGraph annotations for performance reason's, but it turned out a performance loss: expensive HQL-Query parsing takes place every time the method is excuted.
{code:title=QueryImpl.java|borderStyle=solid} private List<X> list() { if (getEntityGraphQueryHint() != null) { SessionImplementor sessionImpl = (SessionImplementor) getEntityManager().getSession(); HQLQueryPlan entityGraphQueryPlan = new HQLQueryPlan( getHibernateQuery().getQueryString(), false, sessionImpl.getEnabledFilters(), sessionImpl.getFactory(), getEntityGraphQueryHint() ); // Safe to assume QueryImpl at this point. unwrap( org.hibernate.internal.QueryImpl.class ).setQueryPlan( entityGraphQueryPlan ); } return query.list(); } {code}
A new HQLQueryPlan is created without checking the QueryPlanCache
|
|