Linq ExpressionParameterVisitor adapted to allow "dynamic" constants

Description

We've had a situation here where we were trying to make linq queries on a "constant" parameter which could change regarding the end user situation.

The query was exactuted nicely, although, the query plan cache was considering it was the same query even when that query was changing.

We patched 4.0.3 with those 3 lines of ExpressionParameterVisitor to make the cache dependent of the constant value.
And we propose you to integrate this (git) patch

Environment

None

Attachments

1

Activity

Show:

Alex Zaytsev July 9, 2015 at 4:24 AM

Closing as duplicate of

Alex Zaytsev July 2, 2015 at 10:56 PM

For the current test, query caches for oddIds and evenIds should be the same, as they have the same length. See the broken test - ParameterisedQueries.Expressions_Differing_Only_By_Constants_Return_The_Same_Key

Alex Zaytsev July 2, 2015 at 10:49 PM

In the current state the patch is unacceptable, because it basically breaks query-caching. But I would like to accept a patch which would allow the IHqlGeneratorForMethod to decide how to build a query plan, this can be a great addition and will finally solve

Alex Zaytsev July 2, 2015 at 10:23 PM

I believe that this patch breaks caching. I will review it today, and update the status accordingly. But, most likely, it will be rejected.

Sÿl July 2, 2015 at 8:11 PM

is there a way to add this to 4.1.0 ? We'd love not have to compile by ourselves this, it's quite helpful!

Anything we can do to help ?

Duplicate

Details

Assignee

Reporter

Labels

Components

Affects versions

Priority

Who's Looking?

Open Who's Looking?

Created April 23, 2015 at 2:16 PM
Updated July 9, 2015 at 4:24 AM
Resolved July 9, 2015 at 4:24 AM
Who's Looking?