Class QueryPlanEqualityComparer
Equality comparer that keys a whole QueryCommand plan (shape flags, expressions, joins, paging, ...) in the plan cache.
public sealed class QueryPlanEqualityComparer : IEqualityComparer<QueryCommand?>
- Inheritance
-
QueryPlanEqualityComparer
- Implements
- Inherited Members
- Extension Methods
Constructors
QueryPlanEqualityComparer(IQueryRegistry)
Creates a comparer that reuses the registry's expression and shape comparers.
public QueryPlanEqualityComparer(IQueryRegistry queryProvider)
Parameters
queryProviderIQueryRegistryThe registry owning the nested comparers.
Methods
Equals(QueryCommand?, QueryCommand?)
Determines whether two commands would produce the same cached plan.
public bool Equals(QueryCommand? x, QueryCommand? y)
Parameters
xQueryCommandThe first command.
yQueryCommandThe second command.
Returns
- bool
truewhen both commands are logically equal.
GetHashCode(QueryCommand?)
Returns the plan-cache hash of obj, combining the precomputed sub-plan
hashes with the plan-shape flags, paging and outer references.
public int GetHashCode(QueryCommand? obj)
Parameters
objQueryCommandThe command to hash.
Returns
- int
The plan hash, or
0whenobjisnull.