Esempio n. 1
0
        protected override BoundRelation RewriteHashMatchRelation(BoundHashMatchRelation node)
        {
            _recorder.Record(node.BuildKey);
            _recorder.Record(node.ProbeKey);

            if (node.Remainder != null)
            {
                _recorder.Record(node.Remainder);
            }

            return(base.RewriteHashMatchRelation(node));
        }
Esempio n. 2
0
        private static ShowPlanNode BuildHashMatch(BoundHashMatchRelation node)
        {
            var properties   = Enumerable.Empty <KeyValuePair <string, string> >();
            var leftAndRight = new[]
            {
                Build(node.Build),
                Build(node.Probe)
            };

            var children = node.Remainder == null
                               ? leftAndRight
                               : leftAndRight.Concat(new[] { Build(node.Remainder) });

            return(new ShowPlanNode($"Hash Match ({node.LogicalOperator}) [{node.BuildKey} = {node.ProbeKey}]", properties, children));
        }
Esempio n. 3
0
        private Iterator BuildHashMatch(BoundHashMatchRelation relation)
        {
            var build           = BuildRelation(relation.Build);
            var buildAllocation = BuildRowBufferAllocation(relation.Build, build.RowBuffer);
            var buildEntry      = buildAllocation[relation.BuildKey];

            var probe           = BuildRelation(relation.Probe);
            var probeAllocation = BuildRowBufferAllocation(relation.Probe, probe.RowBuffer);
            var probeEntry      = probeAllocation[relation.ProbeKey];

            var outputRowBuffer  = new HashMatchRowBuffer(build.RowBuffer.Count, probe.RowBuffer.Count);
            var outputAllocation = BuildRowBufferAllocation(relation, outputRowBuffer);
            var predicate        = BuildPredicate(relation.Remainder, true, outputAllocation);

            Debug.Assert(buildEntry.RowBuffer == build.RowBuffer);
            Debug.Assert(probeEntry.RowBuffer == probe.RowBuffer);

            return(new HashMatchIterator(relation.LogicalOperator, build, probe, buildEntry.Index, probeEntry.Index, predicate, outputRowBuffer));
        }
 private static CardinalityEstimate EstimateHashMatchRelation(BoundHashMatchRelation relation)
 {
     return(CardinalityEstimate.Unknown);
 }