4 types derived from Var
System.Data.Entity (4)
System\Data\Query\InternalTrees\Vars.cs (4)
106
internal sealed class ParameterVar :
Var
136
internal sealed class ColumnVar :
Var
179
internal sealed class ComputedVar :
Var
189
internal sealed class SetOpVar :
Var
627 references to Var
System.Data.Entity (627)
System\Data\Mapping\FunctionImportMappingComposable.cs (1)
120
Var
relVar = rootProjectOp.Outputs[0];
System\Data\Query\InternalTrees\AncillaryOps.cs (3)
23
private
Var
m_var;
27
internal VarDefOp(
Var
v) : this()
45
internal
Var
Var { get { return m_var; } }
System\Data\Query\InternalTrees\ColumnMap.cs (4)
1036
internal InternalTrees.
Var
Var
1049
internal VarRefColumnMap(md.TypeUsage type, string name, InternalTrees.
Var
v)
1055
internal VarRefColumnMap(InternalTrees.
Var
v)
1096
private InternalTrees.
Var
m_var;
System\Data\Query\InternalTrees\ColumnMapCopier.cs (4)
89
private static
Var
GetReplacementVar(
Var
originalVar, VarMap replacementVarMap)
93
Var
replacementVar = originalVar;
298
Var
replacementVar = GetReplacementVar(columnMap.Var, replacementVarMap);
System\Data\Query\InternalTrees\Command.cs (43)
31
private List<
Var
> m_vars;
61
m_vars = new List<
Var
>();
187
internal VarVec CreateVarVec(
Var
v)
199
internal VarVec CreateVarVec(IEnumerable<
Var
> v)
280
internal static VarList CreateVarList(IEnumerable<
Var
> vars)
367
internal IEnumerable<
Var
> Vars
377
internal
Var
GetVar(int id)
897
internal VarRefOp CreateVarRefOp(
Var
v)
1044
internal VarDefOp CreateVarDefOp(
Var
v)
1058
internal Node CreateVarDefNode(Node definingExpr, out
Var
computedVar)
1076
internal Node CreateVarDefListNode(Node definingExpr, out
Var
computedVar)
1131
internal UnnestOp CreateUnnestOp(
Var
v)
1143
internal UnnestOp CreateUnnestOp(
Var
v, Table t)
1171
internal ProjectOp CreateProjectOp(
Var
v)
1248
internal static SortKey CreateSortKey(
Var
v, bool asc, string collation)
1258
internal static SortKey CreateSortKey(
Var
v, bool asc)
1268
internal static SortKey CreateSortKey(
Var
v)
1343
internal DistinctOp CreateDistinctOp(
Var
keyVar)
1366
internal UnionAllOp CreateUnionAllOp(VarMap leftMap, VarMap rightMap,
Var
branchDiscriminator)
1370
foreach (
Var
v in leftMap.Keys)
1387
foreach (
Var
v in leftMap.Keys)
1403
foreach (
Var
v in leftMap.Keys)
1446
internal PhysicalProjectOp CreatePhysicalProjectOp(
Var
outputVar)
1472
internal static CollectionInfo CreateCollectionInfo(
Var
collectionVar, ColumnMap columnMap, VarList flattenedElementVars, VarVec keys, List<InternalTrees.SortKey> sortKeys, object discriminatorValue)
1490
List<CollectionInfo> collectionInfoList,
Var
discriminatorVar)
1599
IList<Node> inputNodes, IList<
Var
> inputVars,
1600
out Node resultNode, out IList<
Var
> resultVars)
1619
List<
Var
> unionAllVars = new List<
Var
>();
1631
List<
Var
> setOpVars = new List<
Var
>();
1655
internal void BuildUnionAllLadder(IList<Node> inputNodes, IList<
Var
> inputVars,
1656
out Node resultNode, out
Var
resultVar)
1659
IList<
Var
> varList;
1681
internal Node BuildProject(Node inputNode, IEnumerable<
Var
> inputVars,
1691
Var
v = this.CreateComputedVar(expr.Op.Type);
1714
internal Node BuildProject(Node input, Node computedExpression, out
Var
projectVar)
1716
Node projectNode = BuildProject(input, new
Var
[] { }, new Node[] { computedExpression });
1738
internal void BuildOfTypeTree(Node inputNode,
Var
inputVar, TypeUsage desiredType, bool includeSubtypes,
1739
out Node resultNode, out
Var
resultVar)
1756
internal Node BuildFakeTreatProject(Node inputNode,
Var
inputVar, TypeUsage desiredType, out
Var
resultVar)
1797
internal Node BuildCollect(Node relOpNode,
Var
relOpVar)
System\Data\Query\InternalTrees\Dump.cs (12)
238
foreach (
Var
v in op.Keys) {
258
foreach (
Var
v in op.Keys) {
269
foreach (
Var
v in op.Outputs) {
305
foreach (
Var
v in ssnOp.Keys) {
317
foreach (
Var
v in op.Outputs) {
349
foreach (
Var
v in varList) {
400
foreach (
Var
v in op.Outputs) {
417
foreach (
Var
v in op.Outputs) {
470
foreach (
Var
v in op.Outputs) {
552
private void DumpVar(
Var
v) {
565
private void DumpVars(List<
Var
> vars) {
566
foreach (
Var
v in vars) {
System\Data\Query\InternalTrees\NodeInfo.cs (14)
47
internal void InitFrom(IEnumerable<
Var
> varSet)
52
internal void InitFrom(IEnumerable<
Var
> varSet, bool ignoreParameters)
153
foreach (
Var
v in vec)
519
foreach (
Var
v in op.Table.Columns)
562
internal static Dictionary<
Var
,
Var
> ComputeVarRemappings(Node varDefListNode)
566
Dictionary<
Var
,
Var
> varMap = new Dictionary<
Var
,
Var
>();
602
foreach (
Var
v in op.Outputs)
645
Dictionary<
Var
,
Var
> varRenameMap = ComputeVarRemappings(n.Child1);
1195
foreach (
Var
v in op.Keys)
System\Data\Query\InternalTrees\OpCopier.cs (20)
46
foreach (
Var
v in varList)
48
Var
newVar = varMap[v];
108
private
Var
GetMappedVar(
Var
v)
110
Var
mappedVar;
141
private void SetMappedVar(
Var
v,
Var
mappedVar)
167
private IEnumerable<
Var
> MapVars(IEnumerable<
Var
> vars)
169
foreach (
Var
v in vars)
171
Var
mappedVar = GetMappedVar(v);
509
Var
newVar;
716
Var
mappedVar = GetMappedVar(op.Var);
920
foreach (KeyValuePair<
Var
,
Var
> kv in op.VarMap[0])
923
Var
outputVar = m_destCmd.CreateSetOpVar(kv.Key.Type);
938
Var
branchDiscriminator = ((UnionAllOp)op).BranchDiscriminator;
1047
Var
newVar = m_destCmd.CreateComputedVar(op.Var.Type);
1105
Var
newDiscriminator = null;
1115
Var
newCollectionVar = m_destCmd.CreateComputedVar(ci.CollectionVar.Type);
System\Data\Query\InternalTrees\PhysicalOps.cs (6)
103
internal
Var
CollectionVar
152
internal CollectionInfo(
Var
collectionVar, ColumnMap columnMap, VarList flattenedElementVars, VarVec keys, List<InternalTrees.SortKey> sortKeys, object discriminatorValue)
164
private
Var
m_collectionVar; // the collection Var
241
internal
Var
Discriminator
289
Var
discriminatorVar)
300
private
Var
m_discriminator; // Var describing the discriminator
System\Data\Query\InternalTrees\RelOps.cs (9)
146
private
Var
m_var;
150
internal UnnestOp(
Var
v, Table t) : this()
167
internal
Var
Var { get { return m_var; } }
528
private
Var
m_var;
534
internal SortKey(
Var
v, bool asc, string collation)
546
internal
Var
Var
874
private
Var
m_branchDiscriminator;
880
internal UnionAllOp(VarVec outputs, VarMap left, VarMap right,
Var
branchDiscriminator) : base(OpType.UnionAll, outputs, left, right)
893
internal
Var
BranchDiscriminator { get { return m_branchDiscriminator; } }
System\Data\Query\InternalTrees\ScalarOps.cs (3)
301
private
Var
m_var;
305
internal VarRefOp(
Var
v) : base(OpType.VarRef, v.Type)
337
internal
Var
Var { get { return m_var; } }
System\Data\Query\InternalTrees\Vars.cs (28)
207
internal class VarVec : IEnumerable<
Var
>
213
internal class VarVecEnumerator : IEnumerator<
Var
>, IDisposable
249
public
Var
Current
251
get { return (m_position >= 0 && m_position < m_bitArray.Count) ? m_command.GetVar(m_position) : (
Var
)null; }
378
internal void InitFrom(IEnumerable<
Var
> other)
383
internal void InitFrom(IEnumerable<
Var
> other, bool ignoreParameters)
386
foreach (
Var
v in other)
399
public IEnumerator<
Var
> GetEnumerator()
417
foreach (
Var
v in this)
423
internal bool IsSet(
Var
v)
428
internal void Set(
Var
v)
433
internal void Clear(
Var
v)
450
internal
Var
First
454
foreach (
Var
v in this)
468
internal VarVec Remap(Dictionary<
Var
,
Var
> varMap)
471
foreach (
Var
v in this)
473
Var
newVar;
525
foreach (
Var
v in this)
558
internal class VarList : List<
Var
>
570
internal VarList(IEnumerable<
Var
> vars) : base(vars) { }
585
foreach (
Var
v in this)
601
internal class VarMap: Dictionary<
Var
,
Var
>
608
foreach (KeyValuePair<
Var
,
Var
> kv in this)
610
Var
x;
627
foreach (
Var
v in this.Keys)
System\Data\Query\PlanCompiler\AggregatePushdown.cs (23)
49
private readonly
Var
_groupAggregateVar;
58
internal GroupAggregateVarInfo(Node defingingGroupNode,
Var
groupAggregateVar)
104
internal
Var
GroupAggregateVar
174
private readonly Dictionary<
Var
, GroupAggregateVarRefInfo> _groupAggregateVarRelatedVarToInfo = new Dictionary<
Var
, GroupAggregateVarRefInfo>();
175
private Dictionary<
Var
, Dictionary<EdmMember, GroupAggregateVarRefInfo>> _groupAggregateVarRelatedVarPropertyToInfo;
199
internal void Add(
Var
var, GroupAggregateVarInfo groupAggregateVarInfo, Node computationTemplate, bool isUnnested)
214
internal void Add(
Var
var, GroupAggregateVarInfo groupAggregateVarInfo, Node computationTemplate, bool isUnnested, EdmMember property)
223
this._groupAggregateVarRelatedVarPropertyToInfo = new Dictionary<
Var
, Dictionary<System.Data.Metadata.Edm.EdmMember, GroupAggregateVarRefInfo>>();
245
internal bool TryGetReferencedGroupAggregateVarInfo(
Var
var, out GroupAggregateVarRefInfo groupAggregateVarRefInfo)
258
internal bool TryGetReferencedGroupAggregateVarInfo(
Var
var, EdmMember property, out GroupAggregateVarRefInfo groupAggregateVarRefInfo)
432
Dictionary<
Var
, Node> constantDefinitions = new Dictionary<
Var
, Node>();
480
Var
outputVar = physicalProjectOp.Outputs[0];
526
private Node TranslateOverGroupAggregateVar(
Var
var, EdmMember property)
718
Var
groupAggregateVar = ((VarDefOp)child.Op).Var;
813
internal static bool IsVarRefOverGivenVar(Node node,
Var
var)
904
Var
inputVar = definingGroupOp.Inputs.First;
912
Dictionary<
Var
,
Var
> dictionary = new Dictionary<
Var
,
Var
>(1);
921
Var
newFunctionVar;
System\Data\Query\PlanCompiler\CodeGen.cs (5)
109
Dictionary<
Var
, KeyValuePair<int, int>> varMap = BuildVarMap();
120
private Dictionary<
Var
, KeyValuePair<int, int>> BuildVarMap()
122
Dictionary<
Var
, KeyValuePair<int, int>> varMap =
123
new Dictionary<
Var
, KeyValuePair<int, int>>();
131
foreach (
Var
v in projectOp.Outputs)
System\Data\Query\PlanCompiler\ColumnMapProcessor.cs (3)
65
private IEnumerator<
Var
> m_varList;
77
private
Var
GetNextVar()
467
Var
newVar = GetNextVar();
System\Data\Query\PlanCompiler\ColumnMapTranslator.cs (10)
85
private static
Var
GetReplacementVar(
Var
originalVar, Dictionary<
Var
,
Var
> replacementVarMap)
89
Var
replacementVar = originalVar;
123
internal static ColumnMap Translate(ColumnMap columnMapToTranslate, Dictionary<
Var
, ColumnMap> varToColumnMap)
157
internal static ColumnMap Translate(ColumnMap columnMapToTranslate, Dictionary<
Var
,
Var
> varToVarMap)
165
Var
replacementVar = GetReplacementVar(varRefColumnMap.Var, varToVarMap);
184
internal static ColumnMap Translate(ColumnMap columnMapToTranslate, Dictionary<
Var
, KeyValuePair<int, int>> varToCommandColumnMap)
System\Data\Query\PlanCompiler\CTreeGenerator.cs (29)
66
private
Var
_var;
73
internal
Var
Var { get { return _var; } }
84
internal VarInfo(
Var
target)
140
internal bool TryGetInfo(
Var
targetVar, out VarInfo varInfo)
167
internal abstract bool TryResolveVar(
Var
targetVar, out DbExpression resultExpr);
190
internal override bool TryResolveVar(
Var
targetVar, out DbExpression resultExpr)
290
private Dictionary<
Var
, DbExpression> _definedVars;
292
internal VarDefScope(Dictionary<
Var
, DbExpression> definedVars)
303
internal override bool TryResolveVar(
Var
targetVar, out DbExpression resultExpr)
517
Dictionary<
Var
, DbExpression> varDefs = new Dictionary<
Var
, DbExpression>();
579
private DbExpression ResolveVar(
Var
referencedVar)
1130
private static string GenerateNameForVar(
Var
projectedVar, Dictionary<string, AliasGenerator> aliasMap,
1191
private DbExpression CreateProject(RelOpInfo sourceInfo, IEnumerable<
Var
> outputVars)
1210
foreach (
Var
projectedVar in outputVars)
1401
private RelOpInfo BuildProjection(Node relOpNode, IEnumerable<
Var
> projectionVars)
1441
DbExpression VisitProject(ProjectOp op, Node n, IEnumerable<
Var
> varList)
1691
List<
Var
> outputAggVars = new List<
Var
>(op.Outputs);
1692
foreach (
Var
keyVar in op.Keys)
1735
Dictionary<
Var
, DbAggregate> aggMap = new Dictionary<
Var
,DbAggregate>();
1743
Var
aggVar = aggVarDef.Var;
1781
foreach(
Var
aggVar in outputAggVars)
2099
List<
Var
> projectionVars = new List<
Var
>();
2116
foreach (
Var
v in outputVars)
2173
foreach (
Var
outputVar in op.Outputs)
2346
foreach (
Var
v in op.Outputs)
System\Data\Query\PlanCompiler\ITreeGenerator.cs (47)
64
private
Var
_var;
66
internal ExpressionBindingScope(Command iqtTree, string name,
Var
iqtVar)
87
internal
Var
ScopeVar { get { return _var; } }
161
private void MapCopiedNodeVars(IList<Node> sources, IList<Node> copies, Dictionary<
Var
,
Var
> varMappings)
183
Var
sourceVar = null;
198
private readonly Dictionary<Node,
Var
> _varMap = new Dictionary<Node,
Var
>();
244
internal Dictionary<Node,
Var
> VarMap { get { return _varMap; } }
305
Var
newVar;
684
Var
inputCollectionVar;
707
Var
projectVar;
734
Var
inputVar = _varMap[input];
754
Var
inputVar = _varMap[input];
790
Var
boundVar;
802
private Node VisitBoundExpression(DbExpression boundExpression, out
Var
boundVar)
830
private void PushBindingScope(
Var
boundVar, string bindingName)
940
private Node ProjectNewRecord(Node inputNode, RowType recType, IEnumerable<
Var
> colVars)
946
foreach (
Var
colVar in colVars)
959
Var
newRecordVar;
1141
Var
nodeVar = _varMap[node];
1149
Var
projectVar;
1421
Var
inputVar = _varMap[inputNode];
1540
Var
inputVar = _varMap[inputSetNode];
1555
Var
inputVar = _varMap[inputSetNode];
1610
Var
outputVar = _iqtCommand.CreateSetOpVar(TypeHelpers.GetEdmType<CollectionType>(expression.ResultType).TypeUsage);
2016
Var
inputVar = _varMap[inputNode];
2023
Var
resultVar;
2151
Var
singleColumn = op.Table.Columns[0];
2231
Var
sourceVar;
2253
Var
projectionVar;
2300
List<
Var
> inputVars = new List<
Var
>();
2303
Var
boundVar;
2439
new
Var
[] { _varMap[inputNode], _varMap[applyNode] }
2500
Var
aggVar;
2608
Var
keyVar;
2627
private Node ProcessFunctionAggregate(DbFunctionAggregate funcAgg, IList<Node> argNodes, out
Var
aggVar)
2669
private Node ProcessGroupAggregate(List<Node> keyVarDefNodes, Node copyOfInput, List<Node> copyOfkeyVarDefNodes, VarVec copyKeyVarSet, TypeUsage inputResultType, out
Var
groupAggVar)
2671
Var
inputVar = this._varMap[copyOfInput];
2696
Var
keyVar = ((VarDefOp)keyVarDef.Op).Var;
2697
Var
copyOfKeyVar = ((VarDefOp)copyOfKeyVarDef.Op).Var;
2798
private Node VisitSortArguments(DbExpressionBinding input, IList<DbSortClause> sortOrder, List<SortKey> sortKeys, out
Var
inputVar)
2843
Var
specVar;
2895
Var
inputVar;
2931
Var
inputVar;
3013
Var
inputVar = _varMap[inputNode];
System\Data\Query\PlanCompiler\JoinElimination.cs (2)
120
foreach (KeyValuePair<
Var
,
Var
> kv in remappedVars)
System\Data\Query\PlanCompiler\JoinGraph.cs (27)
489
private Dictionary<
Var
, VarVec> m_reverseVarMap;
490
private Dictionary<
Var
, AugmentedTableNode> m_varToDefiningNodeMap; //Includes all replacing vars and referenced vars from replacing tables
518
m_reverseVarMap = new Dictionary<
Var
, VarVec>();
519
m_varToDefiningNodeMap = new Dictionary<
Var
, AugmentedTableNode>();
592
foreach (
Var
v in varVec)
607
private static void GetColumnVars(List<ColumnVar> columnVars, IEnumerable<
Var
> vec)
609
foreach (
Var
v in vec)
659
List<
Var
> tempLeftVars;
660
List<
Var
> tempRightVars;
1483
List<T> tableVars, List<T> replacementVars) where T :
Var
1522
foreach (
Var
var in replacementNode.Table.ReferencedColumns)
1536
private void AddReverseMapping(
Var
replacingVar,
Var
replacedVar)
1591
MarkTableAsEliminated<
Var
>(tableNode, replacementNode, tableNode.Table.Columns, replacementNode.Table.Columns);
1717
foreach (
Var
v in joinEdge.RightVars)
1808
foreach (
Var
v in joinEdge.LeftVars)
1970
foreach (
var
key in joinEdge.Right.Table.Keys)
2294
foreach (KeyValuePair<
Var
,
Var
> kv in m_varMap)
2296
Var
newVar1 = kv.Value;
2297
Var
newVar2;
2336
foreach (
Var
v in remappedVarVec)
2405
foreach (
Var
var in joinNode.OtherPredicate.GetNodeInfo(this.m_command).ExternalReferences)
2407
Var
newVar;
2419
Var
newLeftVar;
2420
Var
newRightVar;
2754
private int GetLocationId(
Var
var, int defaultLocationId)
System\Data\Query\PlanCompiler\KeyPullup.cs (8)
143
Dictionary<
Var
,
Var
> varRenameMap = NodeInfoVisitor.ComputeVarRemappings(n.Child1);
230
Var
outputBranchDiscriminatorVar = m_command.CreateSetOpVar(m_command.IntegerType);
268
foreach (
Var
v in allKeyVarsMissingFromOutput)
270
Var
newKeyVar = m_command.CreateSetOpVar(v.Type);
288
Var
branchDiscriminatorVar;
329
Var
keyVar = allKeyVarsMissingFromOutput[j];
360
foreach (
Var
v in op.VarMap[i].Values)
System\Data\Query\PlanCompiler\NestPullup.cs (81)
60
private Dictionary<
Var
, Node> m_definingNodeMap = new Dictionary<
Var
, Node>();
71
private Dictionary<
Var
,
Var
> m_varRefMap = new Dictionary<
Var
,
Var
>();
166
private
Var
ResolveVarReference(
Var
refVar)
168
Var
x = refVar;
184
private void UpdateReplacementVarMap(IEnumerable<
Var
> fromVars, IEnumerable<
Var
> toVars)
186
IEnumerator<
Var
> toVarEnumerator = toVars.GetEnumerator();
188
foreach (
Var
v in fromVars)
210
private static void RemapSortKeys(List<InternalTrees.SortKey> sortKeys, Dictionary<
Var
,
Var
> varMap)
216
Var
replacementVar;
232
private IEnumerable<
Var
> RemapVars(IEnumerable<
Var
> vars, Dictionary<
Var
,
Var
> varMap)
234
foreach (
Var
v in vars)
236
Var
mappedVar;
254
private VarList RemapVarList(VarList varList, Dictionary<
Var
,
Var
> varMap)
266
private VarVec RemapVarVec(VarVec varVec, Dictionary<
Var
,
Var
> varMap)
342
Var
refVar = ((VarRefOp)chi.Op).Var;
363
Var
inputVar = ((ProjectOp)n.Child0.Op).Outputs.First;
502
Var
sentinelVar = null;
566
private Node ApplyIsNotNullFilter(Node node,
Var
sentinelVar)
597
private Node CapWithIsNotNullFilter(Node input,
Var
var)
1012
Var
refVar = ((VarRefOp)definingExprNode.Op).Var;
1188
Var
defVar = varDefOp.Var;
1189
Var
refVar = ResolveVarReference(defVar);
1206
Var
defVar = varDefOp.Var;
1207
Var
refVar = ResolveVarReference(defVar);
1229
private void ConvertToNestOpInput(Node physicalProjectNode,
Var
collectionVar, List<CollectionInfo> collectionInfoList, List<Node> collectionNodes, VarVec externalReferences, VarVec collectionReferences)
1440
Var
tempVar;
1776
Var
refVar = ((VarRefOp)newNode.Op).Var;
1790
IEnumerable<
Var
> inputVars = ((PhysicalProjectOp)newNode.Op).Outputs;
1835
Dictionary<
Var
, Node> collectionVarDefinitions;
1842
foreach (KeyValuePair<
Var
, Node> collectionVarDefinitionPair in collectionVarDefinitions)
1857
Var
keyDefiningVar = reverseMap[collectionVarDefinitionPair.Key];
1957
Dictionary<
Var
, ColumnMap> varRefReplacementMap = new Dictionary<
Var
, ColumnMap>();
2045
foreach (
Var
v in ssnOp.Keys)
2117
private Node ConvertToSingleStreamNest(Node nestNode, Dictionary<
Var
, ColumnMap> varRefReplacementMap, VarList flattenedOutputVarList, out SimpleColumnMap[] parentKeyColumnMaps)
2192
List<Dictionary<
Var
,
Var
>> varMapList;
2193
Var
outputDiscriminatorVar;
2195
Dictionary<
Var
,
Var
> drivingNodeVarMap = varMapList[0];
2220
foreach (KeyValuePair<
Var
,
Var
> kv in drivingNodeVarMap)
2248
foreach (
Var
keyVar in parentKeys)
2289
foreach (
Var
v in newFlattenedElementVars)
2302
foreach (
Var
keyVar in newCollectionInfo.Keys)
2417
Var
discriminatorVar;
2431
private Node AugmentNodeWithInternalIntegerConstant(Node input, int value, out
Var
internalConstantVar)
2445
private Node AugmentNodeWithConstant(Node input, Func<ConstantBaseOp> createOp, out
Var
constantVar)
2475
private Node BuildUnionAllSubqueryForNestOp(NestBaseOp nestOp, Node nestNode, VarList drivingNodeVars, VarList discriminatorVarList, out
Var
discriminatorVar, out List<Dictionary<
Var
,
Var
>> varMapList)
2555
foreach (
Var
v in otherCollectionInfo.FlattenedElementVars)
2559
Var
nullOpVar;
2586
Var
outputVar = Command.CreateSetOpVar(unionAllOutputs[idx].Type);
2601
varMapList = new List<Dictionary<
Var
,
Var
>>();
2602
IEnumerator<
Var
> outputVarsEnumerator = unionAllOutputs.GetEnumerator();
2613
Dictionary<
Var
,
Var
> varMap = new Dictionary<
Var
,
Var
>();
2615
foreach (
Var
v in varList)
2644
Dictionary<
Var
,
Var
> reverseVarMap = varMap.GetReverseMap();
2647
foreach (
Var
v in leftVars)
2649
Var
newVar = reverseVarMap[v];
2669
private Dictionary<
Var
, Node> m_newCollectionVarDefinitions = new Dictionary<
Var
, Node>();
2689
internal static Node Copy(Command cmd, Node n, out VarMap varMap, out Dictionary<
Var
, Node> newCollectionVarDefinitions)
System\Data\Query\PlanCompiler\NominalTypeEliminator.cs (38)
107
private readonly Dictionary<
Var
, PropertyRefList> m_varPropertyMap;
123
Dictionary<
Var
, PropertyRefList> varPropertyMap,
157
Dictionary<
Var
, PropertyRefList> varPropertyMap;
681
foreach (
Var
v in varInfo.NewVars)
699
private Node CreateTVFProjection(Node unnestNode, List<
Var
> unnestOpTableColumns, TypeInfo unnestOpTableTypeInfo, out List<
Var
> newVars)
704
List<
Var
> convertToFlattenedTypeVars = new List<
Var
>();
718
Var
var = null;
827
Var
newVar;
838
List<
Var
> newVars = new List<
Var
>();
875
Var
newVar;
923
Var
newVar;
998
private IEnumerable<
Var
> FlattenVars(IEnumerable<
Var
> vars)
1000
foreach (
Var
v in vars)
1010
foreach (
Var
newVar in varInfo.NewVars)
1156
Var
columnVar = op.Table.Columns[0];
1198
internal static
Var
GetSingletonVar(Node n)
1258
Var
inputVar = GetSingletonVar(n.Child0);
1262
Var
columnVar = op.Table.Columns[0];
1319
Var
newUnnestVar = null;
1377
Var
unnestTableColumnVar = op.Table.Columns[0];
1438
List<
Var
> newVars;
1498
foreach (
Var
v in op.VarMap[0].Keys)
1527
foreach (KeyValuePair<
Var
,
Var
> kv in varMap)
1533
foreach (
Var
v in newComputedVars)
1566
foreach (KeyValuePair<
Var
,
Var
> kv in varMap)
1606
Var
outerVar;
1607
Var
innerVar;
1640
Var
newVar = m_command.CreateSetOpVar(newType);
1646
Var
newVar = m_command.CreateSetOpVar(newType);
1654
List<
Var
> newVars = new List<
Var
>();
2538
foreach (
Var
v in varInfo.NewVars)
System\Data\Query\PlanCompiler\Normalizer.cs (4)
100
Var
newVar;
119
Var
newVar;
184
Var
unnestOutputVar = unnestOp.Table.Columns[0];
199
Var
aggVar;
System\Data\Query\PlanCompiler\Predicate.cs (16)
157
out List<
Var
> leftTableEquiJoinColumns, out List<
Var
> rightTableEquiJoinColumns,
161
leftTableEquiJoinColumns = new List<
Var
>();
162
rightTableEquiJoinColumns = new List<
Var
>();
165
Var
leftTableVar;
166
Var
rightTableVar;
188
Var
leftTableVar;
189
Var
rightTableVar;
222
Var
keyVar;
340
private static bool IsEquiJoinPredicate(Node simplePredicateNode, out
Var
leftVar, out
Var
rightVar)
379
out
Var
leftVar, out
Var
rightVar)
381
Var
tempLeftVar;
382
Var
tempRightVar;
475
private bool IsKeyPredicate(Node left, Node right, VarVec keyVars, VarVec definitions, out
Var
keyVar)
System\Data\Query\PlanCompiler\PreProcessor.cs (40)
183
foreach (
Var
v in m_command.Vars)
463
private Node RewriteNavigateOp(Node navigateOpNode, NavigateOp navigateOp, out
Var
outputVar)
517
List<
Var
> scanTableVars = new List<
Var
>();
523
Var
branchVar = tableOp.Table.Columns[0];
529
Var
unionAllVar;
542
Var
projectVar;
574
private Node BuildOfTypeTable(EntitySetBase entitySet, TypeUsage ofType, out
Var
resultVar)
579
Var
tableVar = tableOp.Table.Columns[0];
623
private Node RewriteDerefOp(Node derefOpNode, DerefOp derefOp, out
Var
outputVar)
635
List<
Var
> scanTableVars = new List<
Var
>();
638
Var
tableVar;
645
Var
unionAllVar;
710
out
Var
rsVar, out
Var
esVar)
778
Var
outputVar;
803
Var
outputVar;
836
private Node RewriteFromOneNavigationProperty(RelProperty relProperty, List<RelationshipSet> relationshipSets, Node sourceRefNode, out
Var
outputVar)
844
List<
Var
> scanTableVars = new List<
Var
>(relationshipSets.Count);
848
Var
tableVar;
916
List<
Var
> outputVars = new List<
Var
>(relationshipSets.Count * 2);
919
Var
rsVar;
920
Var
esVar;
931
IList<
Var
> unionAllVars;
947
Node projectNode = m_command.BuildProject(filterNode, new
Var
[] { unionAllVars[1] }, new Node[] { });
1064
Var
outputVar;
1094
Var
projectVar = projectOp.Outputs.First;
1517
Var
outputVar;
1665
Var
scanTableVar = scanTableOp.Table.Columns[0];
1924
Var
resultVar = null;
1939
Var
newVar;
1958
List<
Var
> inputVars = new List<
Var
>();
1962
Var
newVar;
1984
List<
Var
> inputVars = new List<
Var
>();
1991
Var
newVar;
System\Data\Query\PlanCompiler\ProjectionPruner.cs (10)
172
private void AddReference(
Var
v)
181
private void AddReference(IEnumerable<
Var
> varSet)
183
foreach (
Var
v in varSet)
194
private bool IsReferenced(
Var
v)
203
private bool IsUnreferenced(
Var
v)
215
List<
Var
> unreferencedVars = new List<
Var
>();
217
foreach (
Var
v in varMap.Keys)
229
foreach (
Var
v in unreferencedVars)
550
Var
keyVar = ((VarDefOp)keyNode.Op).Var;
System\Data\Query\PlanCompiler\PropertyPushdownHelper.cs (12)
70
private readonly Dictionary<
Var
, PropertyRefList> m_varPropertyRefMap;
80
m_varPropertyRefMap = new Dictionary<
Var
, PropertyRefList>();
97
internal static void Process(Command itree, StructuredTypeInfo structuredTypeInfo, out Dictionary<
Var
, PropertyRefList> varPropertyRefs, out Dictionary<Node, PropertyRefList> nodePropertyRefs)
156
private PropertyRefList GetPropertyRefList(
Var
v)
172
private void AddPropertyRefs(
Var
v, PropertyRefList propertyRefs)
601
foreach (
Var
v in op.Keys)
631
foreach (
Var
v in op.Keys)
705
Var
columnVar = op.Table.Columns[0];
708
Var
inputVar = NominalTypeEliminator.GetSingletonVar(n.Child0);
730
foreach (KeyValuePair<
Var
,
Var
> kv in varMap)
803
foreach (
Var
v in op.Outputs)
System\Data\Query\PlanCompiler\ProviderCommandInfoUtils.cs (5)
70
Dictionary<
Var
, md.EdmProperty> outputVarMap = BuildOutputVarMap(projectOp, collType.TypeUsage);
103
private static Dictionary<
Var
, md.EdmProperty> BuildOutputVarMap(PhysicalProjectOp projectOp, md.TypeUsage outputType)
105
Dictionary<
Var
, md.EdmProperty> outputVarMap = new Dictionary<
Var
, md.EdmProperty>();
110
IEnumerator<
Var
> varEnumerator = projectOp.Outputs.GetEnumerator();
System\Data\Query\PlanCompiler\SubqueryTrackingVisitor.cs (1)
79
protected Node AddSubqueryToParentRelOp(
Var
outputVar, Node subquery)
System\Data\Query\PlanCompiler\TransformationRules.cs (63)
66
internal void AddVarMapping(
Var
oldVar,
Var
newVar)
87
internal Node ReMap(Node node, Dictionary<
Var
, Node> varMap)
156
internal bool IsNonNullable(
Var
var)
266
internal bool IsScalarOpTree(Node node, Dictionary<
Var
, int> varRefMap)
289
internal Dictionary<
Var
, Node> GetVarMap(Node varDefListNode, Dictionary<
Var
, int> varRefMap)
293
Dictionary<
Var
, Node> varMap = new Dictionary<
Var
, Node>();
341
internal Node BuildNullIfExpression(
Var
conditionVar, Node expr)
379
internal static bool TryGetInt32Var(IEnumerable<
Var
> varList, out
Var
int32Var)
381
foreach (
Var
v in varList)
463
foreach (
Var
v in nodeInfo.ExternalReferences)
547
private bool IsScalarOpTree(Node node, Dictionary<
Var
, int> varRefMap, ref int nonLeafNodeCount)
1325
Var
v = ((VarRefOp)isNullNode.Child0.Op).Var;
1476
Dictionary<
Var
, int> varRefMap = new Dictionary<
Var
, int>();
1485
Dictionary<
Var
, Node> varMap = trc.GetVarMap(projectNode.Child1, varRefMap);
1577
Dictionary<
Var
, Node> remapMap = new Dictionary<
Var
, Node>();
1578
foreach (KeyValuePair<
Var
,
Var
> kv in varMap)
1708
Dictionary<
Var
, int> varRefMap = new Dictionary<
Var
, int>();
1732
Dictionary<
Var
, Node> varMap = trc.GetVarMap(groupByNode.Child1, varRefMap);
2032
foreach (
Var
v in childNodeInfo.Definitions)
2036
Var
computedVar;
2047
Var
computedVar;
2121
Dictionary<
Var
, int> varRefMap = new Dictionary<
Var
, int>();
2130
Dictionary<
Var
, Node> varMap = trc.GetVarMap(subProjectNode.Child1, varRefMap);
2340
Var
inputSentinel;
2551
Var
sentinelVar;
2589
foreach (
Var
v in filterPredicateNodeInfo.ExternalReferences)
2711
Var
sentinelVar = inputNodeInfo.NonNullableDefinitions.First;
2931
Var
oldVar = applyRightChildNodeInfo.Definitions.First;
2947
Var
newVar;
3171
private readonly
Var
m_oldVar;
3173
private VarDefinitionRemapper(
Var
oldVar, Command command)
3186
internal static void RemapSubtree(Node root, Command command,
Var
oldVar)
3220
Var
newVar = m_command.CreateComputedVar(n.Child0.Op.Type);
3259
Var
newVar = m_command.CreateSetOpVar(m_oldVar.Type);
3274
private void RemapVarMapKey(VarMap varMap,
Var
newVar)
3276
Var
value = varMap[m_oldVar];
3398
Dictionary<
Var
, int> varRefMap = new Dictionary<
Var
, int>();
3422
Dictionary<
Var
, Node> varMap1 = trc.GetVarMap(joinNode.Child0.Child1, varRefMap);
3423
Dictionary<
Var
, Node> varMap2 = trc.GetVarMap(joinNode.Child1.Child1, varRefMap);
3441
foreach (
Var
v in projectOp2.Outputs)
3473
Dictionary<
Var
, Node> varMap = trc.GetVarMap(projectNode.Child1, varRefMap);
3838
foreach (KeyValuePair<
Var
,
Var
> kv in setOp.VarMap[indexToReturn])
4026
Dictionary<
Var
, Node> varToDefiningNode = new Dictionary<
Var
, Node>(projectNodeVarDefList.Children.Count);
4030
Var
var = ((VarDefOp)varDefNode.Op).Var;
4045
private Dictionary<
Var
, Node> m_varReplacementTable;
4048
private VarRefReplacer(Dictionary<
Var
, Node> varReplacementTable, Command command)
4063
internal static Node Replace(Dictionary<
Var
, Node> varReplacementTable, Node root, Command command)
4128
Var
referencedVar = op.Var;
4257
foreach (
var
column in allInputColumns)
4266
foreach (
var
column in allInputColumns)
4279
Var
newVar;
System\Data\Query\PlanCompiler\VarInfo.cs (31)
71
internal virtual List<
Var
> NewVars { get { return null; } }
80
private List<
Var
> m_newVars; // always a singleton list
86
internal CollectionVarInfo(
Var
newVar) {
87
m_newVars = new List<
Var
>();
94
internal
Var
NewVar { get { return m_newVars[0]; } }
104
internal override List<
Var
> NewVars { get { return m_newVars; } }
114
private Dictionary<md.EdmProperty,
Var
> m_propertyToVarMap;
115
List<
Var
> m_newVars;
128
internal StructuredVarInfo(md.RowType newType, List<
Var
> newVars, List<md.EdmProperty> newTypeProperties, bool newVarsIncludeNullSentinelVar)
155
internal override List<
Var
> NewVars { get { return m_newVars; } }
180
internal bool TryGetVar(md.EdmProperty p, out
Var
v) {
203
m_propertyToVarMap = new Dictionary<md.EdmProperty,
Var
>();
204
IEnumerator<
Var
> newVarEnumerator = m_newVars.GetEnumerator();
219
private List<
Var
> m_newVars; // always a singleton list
225
/// New <see cref="
Var
"/> that replaces current <see cref="
Var
"/>.
227
internal PrimitiveTypeVarInfo(
Var
newVar)
230
m_newVars = new List<
Var
>() { newVar };
236
internal
Var
NewVar { get { return m_newVars[0]; } }
249
internal override List<
Var
> NewVars { get { return m_newVars; } }
257
private Dictionary<
Var
, VarInfo> m_map;
263
m_map = new Dictionary<
Var
, VarInfo>();
275
internal VarInfo CreateStructuredVarInfo(
Var
v, md.RowType newType, List<
Var
> newVars, List<md.EdmProperty> newProperties, bool newVarsIncludeNullSentinelVar)
289
internal VarInfo CreateStructuredVarInfo(
Var
v, md.RowType newType, List<
Var
> newVars, List<md.EdmProperty> newProperties)
300
internal VarInfo CreateCollectionVarInfo(
Var
v,
Var
newVar) {
312
internal VarInfo CreatePrimitiveTypeVarInfo(
Var
v,
Var
newVar)
331
internal bool TryGetVarInfo(
Var
v, out VarInfo varInfo) {
System\Data\Query\PlanCompiler\VarRefManager.cs (2)
162
foreach (
Var
var in vars)
211
foreach (
Var
var in op.VarMap[index].Values)
System\Data\Query\PlanCompiler\VarRemapper.cs (23)
39
private readonly Dictionary<
Var
,
Var
> m_varMap;
49
:this(command, new Dictionary<
Var
,
Var
>())
58
internal VarRemapper(Command command, Dictionary<
Var
,
Var
> varMap)
72
internal void AddMapping(
Var
oldVar,
Var
newVar)
128
internal static VarList RemapVarList(Command command, Dictionary<
Var
,
Var
> varMap, VarList varList)
141
private
Var
Map(
Var
v)
143
Var
newVar;
154
private IEnumerable<
Var
> MapVars(IEnumerable<
Var
> vars)
156
foreach (
Var
v in vars)
178
foreach (KeyValuePair<
Var
,
Var
> kv in varMap)
180
Var
newVar = Map(kv.Value);
184
foreach (KeyValuePair<
Var
,
Var
> kv in newVarMap)
243
Var
newVar = Map(op.Var);
295
Var
newVar = Map(op.Var);