Open cokalyoncu opened 2 years ago
@fredericDelaporte is it ok to change as @cokalyoncu suggested it effects performance of our application and we don't know until we investigate deeply ?
var projectConstantsInHql = _stateStack.Peek() || expression.NodeType == ExpressionType.Equal || expression.NodeType == ExpressionType.NotEqual || IsRegisteredFunction(expression);
I don't understand importance of Equal/NotEqual operators. Shouldn't this check at least include all others comparison operators too (<, >, ...)
I don't understand importance of Equal/NotEqual operators. Shouldn't this check at least include all others comparison operators too (<, >, ...)
You are right with other operators (<, >, ...) in our case we just faced this issue with not equal operator. QueryPlanCache is effects application performance under high load.
Hi @bahusoid could you lead us for providing fix for this issue.
What assistance do you need? Just prepare pull request with the fix and a test case. Fix should be applied at least for all comparison operations Maybe others binary operations too - I don't understand this code.
Hql query plan is regenerated each time this query is run. If the query is changed in this way, hql query plan is cached.
This line in
SelectClauseHqlNominator
is causing this trouble:This code should be changed like this: