By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE SalesLedger (Id int PRIMARY KEY IDENTITY, Date date NOT NULL, Total decimal(38,18), INDEX IX (Date, Total));
CREATE TABLE Purchases (Id int PRIMARY KEY IDENTITY, Date date NOT NULL, Total decimal(38,18), INDEX IX (Date, Total));
INSERT SalesLedger (Date, Total)
SELECT GETDATE(), number
FROM master..spt_values;
INSERT Purchases (Date, Total)
SELECT GETDATE(), number
FROM master..spt_values;
5148 rows affected
CREATE VIEW ViewMetrics
AS
Select
Date,
'Sale' as Metric,
Total as Value
From SalesLedger
UNION ALL
Select
Date,
'Purchase' as Metric,
Total as Value
From Purchases;
SET STATISTICS XML ON;
Select SUM(Value) as Sales, Metric
from ViewMetrics
group by Metric
order by Metric;
SELECT SUM(Sales), Date
FROM (
Select SUM(Value) as Sales, Date
from ViewMetrics
Group By Metric, Date
) t
GROUP BY Date;
Sales | Metric |
---|---|
4605953947.000000000000000000 | Purchase |
4605953947.000000000000000000 | Sale |
Microsoft SQL Server 2005 XML Showplan |
---|
<ShowPlanXML xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan" Version="1.564" Build="16.0.1000.6"><BatchSequence><Batch><Statements><StmtSimple StatementText="Select SUM(Value) as Sales, Metric
from ViewMetrics
group by Metric
order by Metric" StatementId="1" StatementCompId="2" StatementType="SELECT" StatementSqlHandle="0x0900143B7AC4452E40AAED6CB17A8C2662CF0000000000000000000000000000000000000000000000000000" DatabaseContextSettingsId="1" ParentObjectId="0" StatementParameterizationType="0" RetrievedFromCache="true" StatementSubTreeCost="0.040693" StatementEstRows="2" SecurityPolicyApplied="false" StatementOptmLevel="FULL" QueryHash="0xF1EF1F4F9009ECA7" QueryPlanHash="0x2F8A6EEEFD572CFE" StatementOptmEarlyAbortReason="GoodEnoughPlanFound" CardinalityEstimationModelVersion="160"><StatementSetOptions QUOTED_IDENTIFIER="true" ARITHABORT="true" CONCAT_NULL_YIELDS_NULL="true" ANSI_NULLS="true" ANSI_PADDING="true" ANSI_WARNINGS="true" NUMERIC_ROUNDABORT="false"></StatementSetOptions><QueryPlan DegreeOfParallelism="0" NonParallelPlanReason="NoParallelPlansInDesktopOrExpressEdition" CachedPlanSize="40" CompileTime="0" CompileCPU="0" CompileMemory="456"><MemoryGrantInfo SerialRequiredMemory="0" SerialDesiredMemory="0" GrantedMemory="0" MaxUsedMemory="0"></MemoryGrantInfo><OptimizerHardwareDependentProperties EstimatedAvailableMemoryGrant="1258238" EstimatedPagesCached="78639" EstimatedAvailableDegreeOfParallelism="1" MaxCompileMemory="1330488"></OptimizerHardwareDependentProperties><TraceFlags IsCompileTime="1"><TraceFlag Value="460" Scope="Global"></TraceFlag><TraceFlag Value="8017" Scope="Global"></TraceFlag></TraceFlags><TraceFlags IsCompileTime="0"><TraceFlag Value="460" Scope="Global"></TraceFlag><TraceFlag Value="8017" Scope="Global"></TraceFlag></TraceFlags><QueryTimeStats ElapsedTime="0" CpuTime="0"></QueryTimeStats><RelOp NodeId="0" PhysicalOp="Merge Join" LogicalOp="Concatenation" EstimateRows="2" EstimateIO="0" EstimateCPU="0.0056023" AvgRowSize="32" EstimatedTotalSubtreeCost="0.040693" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Column="Union1007"></ColumnReference><ColumnReference Column="Expr1009"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="2" Batches="0" ActualElapsedms="0" ActualCPUms="0" ActualScans="0" ActualLogicalReads="0" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row"></RunTimeCountersPerThread></RunTimeInformation><Merge><DefinedValues><DefinedValue><ColumnReference Column="Union1007"></ColumnReference><ColumnReference Column="Expr1002"></ColumnReference><ColumnReference Column="Expr1005"></ColumnReference></DefinedValue><DefinedValue><ColumnReference Column="Expr1009"></ColumnReference><ColumnReference Column="Expr1009"></ColumnReference><ColumnReference Column="Expr1009"></ColumnReference></DefinedValue></DefinedValues><RelOp NodeId="1" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="1" EstimateIO="0" EstimateCPU="0" AvgRowSize="30" EstimatedTotalSubtreeCost="0.0175453" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Column="Expr1002"></ColumnReference><ColumnReference Column="Expr1009"></ColumnReference></OutputList><ComputeScalar><DefinedValues><DefinedValue><ColumnReference Column="Expr1009"></ColumnReference><ScalarOperator ScalarString="CASE WHEN [Expr1022]=(0) THEN NULL ELSE [Expr1023] END"><IF><Condition><ScalarOperator><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Column="Expr1022"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="(0)"></Const></ScalarOperator></Compare></ScalarOperator></Condition><Then><ScalarOperator><Const ConstValue="NULL"></Const></ScalarOperator></Then><Else><ScalarOperator><Identifier><ColumnReference Column="Expr1023"></ColumnReference></Identifier></ScalarOperator></Else></IF></ScalarOperator></DefinedValue></DefinedValues><RelOp NodeId="2" PhysicalOp="Stream Aggregate" LogicalOp="Aggregate" EstimateRows="1" EstimateIO="0" EstimateCPU="0.0015449" AvgRowSize="30" EstimatedTotalSubtreeCost="0.0175453" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Column="Expr1002"></ColumnReference><ColumnReference Column="Expr1022"></ColumnReference><ColumnReference Column="Expr1023"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="1" Batches="0" ActualElapsedms="0" ActualCPUms="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row"></RunTimeCountersPerThread></RunTimeInformation><StreamAggregate><DefinedValues><DefinedValue><ColumnReference Column="Expr1022"></ColumnReference><ScalarOperator ScalarString="COUNT_BIG([fiddle_39398e1c57fb4473b9d0fcd05ec4720b].[dbo].[SalesLedger].[Total])"><Aggregate Distinct="0" AggType="COUNT_BIG"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]" Schema="[dbo]" Table="[SalesLedger]" Column="Total"></ColumnReference></Identifier></ScalarOperator></Aggregate></ScalarOperator></DefinedValue><DefinedValue><ColumnReference Column="Expr1023"></ColumnReference><ScalarOperator ScalarString="SUM([fiddle_39398e1c57fb4473b9d0fcd05ec4720b].[dbo].[SalesLedger].[Total])"><Aggregate Distinct="0" AggType="SUM"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]" Schema="[dbo]" Table="[SalesLedger]" Column="Total"></ColumnReference></Identifier></ScalarOperator></Aggregate></ScalarOperator></DefinedValue><DefinedValue><ColumnReference Column="Expr1002"></ColumnReference><ScalarOperator ScalarString="ANY([Expr1002])"><Aggregate Distinct="0" AggType="ANY"><ScalarOperator><Identifier><ColumnReference Column="Expr1002"></ColumnReference></Identifier></ScalarOperator></Aggregate></ScalarOperator></DefinedValue></DefinedValues><RelOp NodeId="3" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="2574" EstimateIO="0" EstimateCPU="0.0002574" AvgRowSize="30" EstimatedTotalSubtreeCost="0.0160004" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]" Schema="[dbo]" Table="[SalesLedger]" Column="Total"></ColumnReference><ColumnReference Column="Expr1002"></ColumnReference></OutputList><ComputeScalar><DefinedValues><DefinedValue><ColumnReference Column="Expr1002"></ColumnReference><ScalarOperator ScalarString="'Sale'"><Const ConstValue="'Sale'"></Const></ScalarOperator></DefinedValue></DefinedValues><RelOp NodeId="4" PhysicalOp="Index Scan" LogicalOp="Index Scan" EstimateRows="2574" EstimatedRowsRead="2574" EstimateIO="0.0127546" EstimateCPU="0.0029884" AvgRowSize="24" EstimatedTotalSubtreeCost="0.015743" TableCardinality="2574" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]" Schema="[dbo]" Table="[SalesLedger]" Column="Total"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="2574" Batches="0" ActualElapsedms="0" ActualCPUms="0" ActualScans="1" ActualLogicalReads="16" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRowsRead="2574" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row"></RunTimeCountersPerThread></RunTimeInformation><IndexScan Ordered="0" ForcedIndex="0" ForceSeek="0" ForceScan="0" NoExpandHint="0" Storage="RowStore"><DefinedValues><DefinedValue><ColumnReference Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]" Schema="[dbo]" Table="[SalesLedger]" Column="Total"></ColumnReference></DefinedValue></DefinedValues><Object Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]" Schema="[dbo]" Table="[SalesLedger]" Index="[IX]" IndexKind="NonClustered" Storage="RowStore"></Object></IndexScan></RelOp></ComputeScalar></RelOp></StreamAggregate></RelOp></ComputeScalar></RelOp><RelOp NodeId="5" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="1" EstimateIO="0" EstimateCPU="0" AvgRowSize="32" EstimatedTotalSubtreeCost="0.0175453" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Column="Expr1005"></ColumnReference><ColumnReference Column="Expr1009"></ColumnReference></OutputList><ComputeScalar><DefinedValues><DefinedValue><ColumnReference Column="Expr1009"></ColumnReference><ScalarOperator ScalarString="CASE WHEN [Expr1024]=(0) THEN NULL ELSE [Expr1025] END"><IF><Condition><ScalarOperator><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Column="Expr1024"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="(0)"></Const></ScalarOperator></Compare></ScalarOperator></Condition><Then><ScalarOperator><Const ConstValue="NULL"></Const></ScalarOperator></Then><Else><ScalarOperator><Identifier><ColumnReference Column="Expr1025"></ColumnReference></Identifier></ScalarOperator></Else></IF></ScalarOperator></DefinedValue></DefinedValues><RelOp NodeId="6" PhysicalOp="Stream Aggregate" LogicalOp="Aggregate" EstimateRows="1" EstimateIO="0" EstimateCPU="0.0015449" AvgRowSize="32" EstimatedTotalSubtreeCost="0.0175453" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Column="Expr1005"></ColumnReference><ColumnReference Column="Expr1024"></ColumnReference><ColumnReference Column="Expr1025"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="1" Batches="0" ActualElapsedms="0" ActualCPUms="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row"></RunTimeCountersPerThread></RunTimeInformation><StreamAggregate><DefinedValues><DefinedValue><ColumnReference Column="Expr1024"></ColumnReference><ScalarOperator ScalarString="COUNT_BIG([fiddle_39398e1c57fb4473b9d0fcd05ec4720b].[dbo].[Purchases].[Total])"><Aggregate Distinct="0" AggType="COUNT_BIG"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]" Schema="[dbo]" Table="[Purchases]" Column="Total"></ColumnReference></Identifier></ScalarOperator></Aggregate></ScalarOperator></DefinedValue><DefinedValue><ColumnReference Column="Expr1025"></ColumnReference><ScalarOperator ScalarString="SUM([fiddle_39398e1c57fb4473b9d0fcd05ec4720b].[dbo].[Purchases].[Total])"><Aggregate Distinct="0" AggType="SUM"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]" Schema="[dbo]" Table="[Purchases]" Column="Total"></ColumnReference></Identifier></ScalarOperator></Aggregate></ScalarOperator></DefinedValue><DefinedValue><ColumnReference Column="Expr1005"></ColumnReference><ScalarOperator ScalarString="ANY([Expr1005])"><Aggregate Distinct="0" AggType="ANY"><ScalarOperator><Identifier><ColumnReference Column="Expr1005"></ColumnReference></Identifier></ScalarOperator></Aggregate></ScalarOperator></DefinedValue></DefinedValues><RelOp NodeId="7" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="2574" EstimateIO="0" EstimateCPU="0.0002574" AvgRowSize="32" EstimatedTotalSubtreeCost="0.0160004" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]" Schema="[dbo]" Table="[Purchases]" Column="Total"></ColumnReference><ColumnReference Column="Expr1005"></ColumnReference></OutputList><ComputeScalar><DefinedValues><DefinedValue><ColumnReference Column="Expr1005"></ColumnReference><ScalarOperator ScalarString="'Purchase'"><Const ConstValue="'Purchase'"></Const></ScalarOperator></DefinedValue></DefinedValues><RelOp NodeId="8" PhysicalOp="Index Scan" LogicalOp="Index Scan" EstimateRows="2574" EstimatedRowsRead="2574" EstimateIO="0.0127546" EstimateCPU="0.0029884" AvgRowSize="24" EstimatedTotalSubtreeCost="0.015743" TableCardinality="2574" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]" Schema="[dbo]" Table="[Purchases]" Column="Total"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="2574" Batches="0" ActualElapsedms="0" ActualCPUms="0" ActualScans="1" ActualLogicalReads="16" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRowsRead="2574" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row"></RunTimeCountersPerThread></RunTimeInformation><IndexScan Ordered="0" ForcedIndex="0" ForceSeek="0" ForceScan="0" NoExpandHint="0" Storage="RowStore"><DefinedValues><DefinedValue><ColumnReference Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]" Schema="[dbo]" Table="[Purchases]" Column="Total"></ColumnReference></DefinedValue></DefinedValues><Object Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]" Schema="[dbo]" Table="[Purchases]" Index="[IX]" IndexKind="NonClustered" Storage="RowStore"></Object></IndexScan></RelOp></ComputeScalar></RelOp></StreamAggregate></RelOp></ComputeScalar></RelOp></Merge></RelOp></QueryPlan></StmtSimple></Statements></Batch></BatchSequence></ShowPlanXML> |
Select SUM(Value) as Sales, Metric
from ViewMetrics
group by Metric
order by Metric
SELECT
SELECT
Cached plan size | 40 KB |
---|---|
Estimated Operator Cost | 0 (0%) |
Estimated Subtree Cost | 0.040693 |
Degree of Parallelism | 0 |
Estimated Number of Rows | 2 |
Statement
Select SUM(Value) as Sales, Metric
from ViewMetrics
group by Metric
order by Metric
Merge Join
(Concatenation)
Cost: 14%
Merge Join
Physical Operation | Merge Join |
---|---|
Logical Operation | Concatenation |
Actual Execution Mode | Row |
Estimated Execution Mode | Row |
Actual Number of Rows | 2 |
Actual Number of Batches | 0 |
Estimated Operator Cost | 0.0056024 (14%) |
Estimated I/O Cost | 0 |
Estimated CPU Cost | 0.0056023 |
Estimated Subtree Cost | 0.040693 |
Estimated Number of Executions | 1 |
Number of Executions | 1 |
Estimated Number of Rows | 2 |
Estimated Row Size | 32 B |
Actual Rebinds | 0 |
Actual Rewinds | 0 |
Node ID | 0 |
Output List
Union1007
Expr1009
Compute Scalar
Cost: 0%
Compute Scalar
Compute new values from existing values in a row.
Physical Operation | Compute Scalar |
---|---|
Logical Operation | Compute Scalar |
Estimated Execution Mode | Row |
Estimated Operator Cost | 0 (0%) |
Estimated I/O Cost | 0 |
Estimated CPU Cost | 0 |
Estimated Subtree Cost | 0.0175453 |
Estimated Number of Executions | 1 |
Estimated Number of Rows | 1 |
Estimated Row Size | 30 B |
Node ID | 1 |
Output List
Expr1002
Expr1009
Stream Aggregate
(Aggregate)
Cost: 4%
Stream Aggregate
Compute summary values for groups of rows in a suitably sorted stream.
Physical Operation | Stream Aggregate |
---|---|
Logical Operation | Aggregate |
Actual Execution Mode | Row |
Estimated Execution Mode | Row |
Actual Number of Rows | 1 |
Actual Number of Batches | 0 |
Estimated Operator Cost | 0.0015449 (4%) |
Estimated I/O Cost | 0 |
Estimated CPU Cost | 0.0015449 |
Estimated Subtree Cost | 0.0175453 |
Estimated Number of Executions | 1 |
Number of Executions | 1 |
Estimated Number of Rows | 1 |
Estimated Row Size | 30 B |
Actual Rebinds | 0 |
Actual Rewinds | 0 |
Node ID | 2 |
Output List
Expr1002
Expr1022
Expr1023
Compute Scalar
Cost: 1%
Compute Scalar
Compute new values from existing values in a row.
Physical Operation | Compute Scalar |
---|---|
Logical Operation | Compute Scalar |
Estimated Execution Mode | Row |
Estimated Operator Cost | 0.0002574 (1%) |
Estimated I/O Cost | 0 |
Estimated CPU Cost | 0.0002574 |
Estimated Subtree Cost | 0.0160004 |
Estimated Number of Executions | 1 |
Estimated Number of Rows | 2574 |
Estimated Row Size | 30 B |
Node ID | 3 |
Output List
[fiddle_39398e1c57fb4473b9d0fcd05ec4720b].[dbo].[SalesLedger].Total
Expr1002
Index Scan (NonClustered)
[SalesLedger].[IX]
Cost: 39%
Index Scan (NonClustered)
Physical Operation | Index Scan |
---|---|
Logical Operation | Index Scan |
Actual Execution Mode | Row |
Estimated Execution Mode | Row |
Storage | RowStore |
Number of Rows Read | 2574 |
Actual Number of Rows | 2574 |
Actual Number of Batches | 0 |
Estimated Operator Cost | 0.015743 (39%) |
Estimated I/O Cost | 0.0127546 |
Estimated CPU Cost | 0.0029884 |
Estimated Subtree Cost | 0.015743 |
Estimated Number of Executions | 1 |
Number of Executions | 1 |
Estimated Number of Rows to be Read | 2574 |
Estimated Number of Rows | 2574 |
Estimated Row Size | 24 B |
Actual Rebinds | 0 |
Actual Rewinds | 0 |
Ordered | False |
Node ID | 4 |
Output List
[fiddle_39398e1c57fb4473b9d0fcd05ec4720b].[dbo].[SalesLedger].Total
Object
[fiddle_39398e1c57fb4473b9d0fcd05ec4720b].[dbo].[SalesLedger].[IX]
Compute Scalar
Cost: 0%
Compute Scalar
Compute new values from existing values in a row.
Physical Operation | Compute Scalar |
---|---|
Logical Operation | Compute Scalar |
Estimated Execution Mode | Row |
Estimated Operator Cost | 0 (0%) |
Estimated I/O Cost | 0 |
Estimated CPU Cost | 0 |
Estimated Subtree Cost | 0.0175453 |
Estimated Number of Executions | 1 |
Estimated Number of Rows | 1 |
Estimated Row Size | 32 B |
Node ID | 5 |
Output List
Expr1005
Expr1009
Stream Aggregate
(Aggregate)
Cost: 4%
Stream Aggregate
Compute summary values for groups of rows in a suitably sorted stream.
Physical Operation | Stream Aggregate |
---|---|
Logical Operation | Aggregate |
Actual Execution Mode | Row |
Estimated Execution Mode | Row |
Actual Number of Rows | 1 |
Actual Number of Batches | 0 |
Estimated Operator Cost | 0.0015449 (4%) |
Estimated I/O Cost | 0 |
Estimated CPU Cost | 0.0015449 |
Estimated Subtree Cost | 0.0175453 |
Estimated Number of Executions | 1 |
Number of Executions | 1 |
Estimated Number of Rows | 1 |
Estimated Row Size | 32 B |
Actual Rebinds | 0 |
Actual Rewinds | 0 |
Node ID | 6 |
Output List
Expr1005
Expr1024
Expr1025
Compute Scalar
Cost: 1%
Compute Scalar
Compute new values from existing values in a row.
Physical Operation | Compute Scalar |
---|---|
Logical Operation | Compute Scalar |
Estimated Execution Mode | Row |
Estimated Operator Cost | 0.0002574 (1%) |
Estimated I/O Cost | 0 |
Estimated CPU Cost | 0.0002574 |
Estimated Subtree Cost | 0.0160004 |
Estimated Number of Executions | 1 |
Estimated Number of Rows | 2574 |
Estimated Row Size | 32 B |
Node ID | 7 |
Output List
[fiddle_39398e1c57fb4473b9d0fcd05ec4720b].[dbo].[Purchases].Total
Expr1005
Index Scan (NonClustered)
[Purchases].[IX]
Cost: 39%
Index Scan (NonClustered)
Physical Operation | Index Scan |
---|---|
Logical Operation | Index Scan |
Actual Execution Mode | Row |
Estimated Execution Mode | Row |
Storage | RowStore |
Number of Rows Read | 2574 |
Actual Number of Rows | 2574 |
Actual Number of Batches | 0 |
Estimated Operator Cost | 0.015743 (39%) |
Estimated I/O Cost | 0.0127546 |
Estimated CPU Cost | 0.0029884 |
Estimated Subtree Cost | 0.015743 |
Estimated Number of Executions | 1 |
Number of Executions | 1 |
Estimated Number of Rows to be Read | 2574 |
Estimated Number of Rows | 2574 |
Estimated Row Size | 24 B |
Actual Rebinds | 0 |
Actual Rewinds | 0 |
Ordered | False |
Node ID | 8 |
Output List
[fiddle_39398e1c57fb4473b9d0fcd05ec4720b].[dbo].[Purchases].Total
Object
[fiddle_39398e1c57fb4473b9d0fcd05ec4720b].[dbo].[Purchases].[IX]
(No column name) | Date |
---|---|
9211907894.000000000000000000 | 2023-08-29 |
Microsoft SQL Server 2005 XML Showplan |
---|
<ShowPlanXML xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan" Version="1.564" Build="16.0.1000.6"><BatchSequence><Batch><Statements><StmtSimple StatementText="SELECT SUM(Sales), Date
FROM (
 Select SUM(Value) as Sales, Date
 from ViewMetrics
 Group By Metric, Date
) t
GROUP BY Date" StatementId="2" StatementCompId="3" StatementType="SELECT" StatementSqlHandle="0x090078C607A660E542B7B75061F77CBFC2C10000000000000000000000000000000000000000000000000000" DatabaseContextSettingsId="1" ParentObjectId="0" StatementParameterizationType="0" RetrievedFromCache="true" StatementSubTreeCost="0.0401799" StatementEstRows="1" SecurityPolicyApplied="false" StatementOptmLevel="FULL" QueryHash="0xE858FAA683CDBA75" QueryPlanHash="0x9839C6EF432234C6" StatementOptmEarlyAbortReason="GoodEnoughPlanFound" CardinalityEstimationModelVersion="160"><StatementSetOptions QUOTED_IDENTIFIER="true" ARITHABORT="true" CONCAT_NULL_YIELDS_NULL="true" ANSI_NULLS="true" ANSI_PADDING="true" ANSI_WARNINGS="true" NUMERIC_ROUNDABORT="false"></StatementSetOptions><QueryPlan DegreeOfParallelism="0" NonParallelPlanReason="NoParallelPlansInDesktopOrExpressEdition" CachedPlanSize="48" CompileTime="15" CompileCPU="15" CompileMemory="632"><MemoryGrantInfo SerialRequiredMemory="0" SerialDesiredMemory="0" GrantedMemory="0" MaxUsedMemory="0"></MemoryGrantInfo><OptimizerHardwareDependentProperties EstimatedAvailableMemoryGrant="1258238" EstimatedPagesCached="78639" EstimatedAvailableDegreeOfParallelism="1" MaxCompileMemory="1330488"></OptimizerHardwareDependentProperties><OptimizerStatsUsage><StatisticsInfo LastUpdate="2023-08-29T15:44:04.23" ModificationCount="0" SamplingPercent="100" Statistics="[IX]" Table="[SalesLedger]" Schema="[dbo]" Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]"></StatisticsInfo><StatisticsInfo LastUpdate="2023-08-29T15:44:04.23" ModificationCount="0" SamplingPercent="100" Statistics="[IX]" Table="[Purchases]" Schema="[dbo]" Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]"></StatisticsInfo></OptimizerStatsUsage><TraceFlags IsCompileTime="1"><TraceFlag Value="460" Scope="Global"></TraceFlag><TraceFlag Value="8017" Scope="Global"></TraceFlag></TraceFlags><TraceFlags IsCompileTime="0"><TraceFlag Value="460" Scope="Global"></TraceFlag><TraceFlag Value="8017" Scope="Global"></TraceFlag></TraceFlags><QueryTimeStats ElapsedTime="0" CpuTime="0"></QueryTimeStats><RelOp NodeId="0" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="1" EstimateIO="0" EstimateCPU="0" AvgRowSize="27" EstimatedTotalSubtreeCost="0.0401799" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Column="Union1006"></ColumnReference><ColumnReference Column="Expr1010"></ColumnReference></OutputList><ComputeScalar><DefinedValues><DefinedValue><ColumnReference Column="Expr1010"></ColumnReference><ScalarOperator ScalarString="CASE WHEN [Expr1031]=(0) THEN NULL ELSE [Expr1032] END"><IF><Condition><ScalarOperator><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Column="Expr1031"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="(0)"></Const></ScalarOperator></Compare></ScalarOperator></Condition><Then><ScalarOperator><Const ConstValue="NULL"></Const></ScalarOperator></Then><Else><ScalarOperator><Identifier><ColumnReference Column="Expr1032"></ColumnReference></Identifier></ScalarOperator></Else></IF></ScalarOperator></DefinedValue></DefinedValues><RelOp NodeId="1" PhysicalOp="Stream Aggregate" LogicalOp="Aggregate" EstimateRows="1" EstimateIO="0" EstimateCPU="1.7e-06" AvgRowSize="27" EstimatedTotalSubtreeCost="0.0401799" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Column="Union1006"></ColumnReference><ColumnReference Column="Expr1031"></ColumnReference><ColumnReference Column="Expr1032"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="1" Batches="0" ActualElapsedms="0" ActualCPUms="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row"></RunTimeCountersPerThread></RunTimeInformation><StreamAggregate><DefinedValues><DefinedValue><ColumnReference Column="Expr1031"></ColumnReference><ScalarOperator ScalarString="COUNT_BIG([Expr1009])"><Aggregate Distinct="0" AggType="COUNT_BIG"><ScalarOperator><Identifier><ColumnReference Column="Expr1009"></ColumnReference></Identifier></ScalarOperator></Aggregate></ScalarOperator></DefinedValue><DefinedValue><ColumnReference Column="Expr1032"></ColumnReference><ScalarOperator ScalarString="SUM([Expr1009])"><Aggregate Distinct="0" AggType="SUM"><ScalarOperator><Identifier><ColumnReference Column="Expr1009"></ColumnReference></Identifier></ScalarOperator></Aggregate></ScalarOperator></DefinedValue></DefinedValues><GroupBy><ColumnReference Column="Union1006"></ColumnReference></GroupBy><RelOp NodeId="2" PhysicalOp="Merge Join" LogicalOp="Concatenation" EstimateRows="2" EstimateIO="0" EstimateCPU="0.0056023" AvgRowSize="27" EstimatedTotalSubtreeCost="0.0401782" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Column="Union1006"></ColumnReference><ColumnReference Column="Expr1009"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="2" Batches="0" ActualElapsedms="0" ActualCPUms="0" ActualScans="0" ActualLogicalReads="0" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row"></RunTimeCountersPerThread></RunTimeInformation><Merge><DefinedValues><DefinedValue><ColumnReference Column="Union1006"></ColumnReference><ColumnReference Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]" Schema="[dbo]" Table="[SalesLedger]" Column="Date"></ColumnReference><ColumnReference Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]" Schema="[dbo]" Table="[Purchases]" Column="Date"></ColumnReference></DefinedValue><DefinedValue><ColumnReference Column="Expr1009"></ColumnReference><ColumnReference Column="Expr1009"></ColumnReference><ColumnReference Column="Expr1009"></ColumnReference></DefinedValue></DefinedValues><RelOp NodeId="3" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="1" EstimateIO="0" EstimateCPU="0" AvgRowSize="27" EstimatedTotalSubtreeCost="0.0172879" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]" Schema="[dbo]" Table="[SalesLedger]" Column="Date"></ColumnReference><ColumnReference Column="Expr1009"></ColumnReference></OutputList><ComputeScalar><DefinedValues><DefinedValue><ColumnReference Column="Expr1009"></ColumnReference><ScalarOperator ScalarString="CASE WHEN [Expr1027]=(0) THEN NULL ELSE [Expr1028] END"><IF><Condition><ScalarOperator><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Column="Expr1027"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="(0)"></Const></ScalarOperator></Compare></ScalarOperator></Condition><Then><ScalarOperator><Const ConstValue="NULL"></Const></ScalarOperator></Then><Else><ScalarOperator><Identifier><ColumnReference Column="Expr1028"></ColumnReference></Identifier></ScalarOperator></Else></IF></ScalarOperator></DefinedValue></DefinedValues><RelOp NodeId="4" PhysicalOp="Stream Aggregate" LogicalOp="Aggregate" EstimateRows="1" EstimateIO="0" EstimateCPU="0.0015449" AvgRowSize="27" EstimatedTotalSubtreeCost="0.0172879" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]" Schema="[dbo]" Table="[SalesLedger]" Column="Date"></ColumnReference><ColumnReference Column="Expr1027"></ColumnReference><ColumnReference Column="Expr1028"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="1" Batches="0" ActualElapsedms="0" ActualCPUms="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row"></RunTimeCountersPerThread></RunTimeInformation><StreamAggregate><DefinedValues><DefinedValue><ColumnReference Column="Expr1027"></ColumnReference><ScalarOperator ScalarString="COUNT_BIG([fiddle_39398e1c57fb4473b9d0fcd05ec4720b].[dbo].[SalesLedger].[Total])"><Aggregate Distinct="0" AggType="COUNT_BIG"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]" Schema="[dbo]" Table="[SalesLedger]" Column="Total"></ColumnReference></Identifier></ScalarOperator></Aggregate></ScalarOperator></DefinedValue><DefinedValue><ColumnReference Column="Expr1028"></ColumnReference><ScalarOperator ScalarString="SUM([fiddle_39398e1c57fb4473b9d0fcd05ec4720b].[dbo].[SalesLedger].[Total])"><Aggregate Distinct="0" AggType="SUM"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]" Schema="[dbo]" Table="[SalesLedger]" Column="Total"></ColumnReference></Identifier></ScalarOperator></Aggregate></ScalarOperator></DefinedValue></DefinedValues><GroupBy><ColumnReference Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]" Schema="[dbo]" Table="[SalesLedger]" Column="Date"></ColumnReference></GroupBy><RelOp NodeId="5" PhysicalOp="Index Scan" LogicalOp="Index Scan" EstimateRows="2574" EstimatedRowsRead="2574" EstimateIO="0.0127546" EstimateCPU="0.0029884" AvgRowSize="27" EstimatedTotalSubtreeCost="0.015743" TableCardinality="2574" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]" Schema="[dbo]" Table="[SalesLedger]" Column="Date"></ColumnReference><ColumnReference Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]" Schema="[dbo]" Table="[SalesLedger]" Column="Total"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="2574" Batches="0" ActualElapsedms="0" ActualCPUms="0" ActualScans="1" ActualLogicalReads="16" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRowsRead="2574" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row"></RunTimeCountersPerThread></RunTimeInformation><IndexScan Ordered="1" ScanDirection="FORWARD" ForcedIndex="0" ForceSeek="0" ForceScan="0" NoExpandHint="0" Storage="RowStore"><DefinedValues><DefinedValue><ColumnReference Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]" Schema="[dbo]" Table="[SalesLedger]" Column="Date"></ColumnReference></DefinedValue><DefinedValue><ColumnReference Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]" Schema="[dbo]" Table="[SalesLedger]" Column="Total"></ColumnReference></DefinedValue></DefinedValues><Object Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]" Schema="[dbo]" Table="[SalesLedger]" Index="[IX]" IndexKind="NonClustered" Storage="RowStore"></Object></IndexScan></RelOp></StreamAggregate></RelOp></ComputeScalar></RelOp><RelOp NodeId="6" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="1" EstimateIO="0" EstimateCPU="0" AvgRowSize="27" EstimatedTotalSubtreeCost="0.0172879" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]" Schema="[dbo]" Table="[Purchases]" Column="Date"></ColumnReference><ColumnReference Column="Expr1009"></ColumnReference></OutputList><ComputeScalar><DefinedValues><DefinedValue><ColumnReference Column="Expr1009"></ColumnReference><ScalarOperator ScalarString="CASE WHEN [Expr1029]=(0) THEN NULL ELSE [Expr1030] END"><IF><Condition><ScalarOperator><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Column="Expr1029"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="(0)"></Const></ScalarOperator></Compare></ScalarOperator></Condition><Then><ScalarOperator><Const ConstValue="NULL"></Const></ScalarOperator></Then><Else><ScalarOperator><Identifier><ColumnReference Column="Expr1030"></ColumnReference></Identifier></ScalarOperator></Else></IF></ScalarOperator></DefinedValue></DefinedValues><RelOp NodeId="7" PhysicalOp="Stream Aggregate" LogicalOp="Aggregate" EstimateRows="1" EstimateIO="0" EstimateCPU="0.0015449" AvgRowSize="27" EstimatedTotalSubtreeCost="0.0172879" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]" Schema="[dbo]" Table="[Purchases]" Column="Date"></ColumnReference><ColumnReference Column="Expr1029"></ColumnReference><ColumnReference Column="Expr1030"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="1" Batches="0" ActualElapsedms="0" ActualCPUms="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row"></RunTimeCountersPerThread></RunTimeInformation><StreamAggregate><DefinedValues><DefinedValue><ColumnReference Column="Expr1029"></ColumnReference><ScalarOperator ScalarString="COUNT_BIG([fiddle_39398e1c57fb4473b9d0fcd05ec4720b].[dbo].[Purchases].[Total])"><Aggregate Distinct="0" AggType="COUNT_BIG"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]" Schema="[dbo]" Table="[Purchases]" Column="Total"></ColumnReference></Identifier></ScalarOperator></Aggregate></ScalarOperator></DefinedValue><DefinedValue><ColumnReference Column="Expr1030"></ColumnReference><ScalarOperator ScalarString="SUM([fiddle_39398e1c57fb4473b9d0fcd05ec4720b].[dbo].[Purchases].[Total])"><Aggregate Distinct="0" AggType="SUM"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]" Schema="[dbo]" Table="[Purchases]" Column="Total"></ColumnReference></Identifier></ScalarOperator></Aggregate></ScalarOperator></DefinedValue></DefinedValues><GroupBy><ColumnReference Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]" Schema="[dbo]" Table="[Purchases]" Column="Date"></ColumnReference></GroupBy><RelOp NodeId="8" PhysicalOp="Index Scan" LogicalOp="Index Scan" EstimateRows="2574" EstimatedRowsRead="2574" EstimateIO="0.0127546" EstimateCPU="0.0029884" AvgRowSize="27" EstimatedTotalSubtreeCost="0.015743" TableCardinality="2574" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]" Schema="[dbo]" Table="[Purchases]" Column="Date"></ColumnReference><ColumnReference Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]" Schema="[dbo]" Table="[Purchases]" Column="Total"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="2574" Batches="0" ActualElapsedms="0" ActualCPUms="0" ActualScans="1" ActualLogicalReads="16" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRowsRead="2574" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row"></RunTimeCountersPerThread></RunTimeInformation><IndexScan Ordered="1" ScanDirection="FORWARD" ForcedIndex="0" ForceSeek="0" ForceScan="0" NoExpandHint="0" Storage="RowStore"><DefinedValues><DefinedValue><ColumnReference Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]" Schema="[dbo]" Table="[Purchases]" Column="Date"></ColumnReference></DefinedValue><DefinedValue><ColumnReference Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]" Schema="[dbo]" Table="[Purchases]" Column="Total"></ColumnReference></DefinedValue></DefinedValues><Object Database="[fiddle_39398e1c57fb4473b9d0fcd05ec4720b]" Schema="[dbo]" Table="[Purchases]" Index="[IX]" IndexKind="NonClustered" Storage="RowStore"></Object></IndexScan></RelOp></StreamAggregate></RelOp></ComputeScalar></RelOp></Merge></RelOp></StreamAggregate></RelOp></ComputeScalar></RelOp></QueryPlan></StmtSimple></Statements></Batch></BatchSequence></ShowPlanXML> |
SELECT SUM(Sales), Date
FROM (
Select SUM(Value) as Sales, Date
from ViewMetrics
Group By Metric, Date
) t
GROUP BY Date
SELECT
SELECT
Cached plan size | 48 KB |
---|---|
Estimated Operator Cost | 0 (0%) |
Estimated Subtree Cost | 0.0401799 |
Degree of Parallelism | 0 |
Estimated Number of Rows | 1 |
Statement
SELECT SUM(Sales), Date
FROM (
Select SUM(Value) as Sales, Date
from ViewMetrics
Group By Metric, Date
) t
GROUP BY Date
Compute Scalar
Cost: 0%
Compute Scalar
Compute new values from existing values in a row.
Physical Operation | Compute Scalar |
---|---|
Logical Operation | Compute Scalar |
Estimated Execution Mode | Row |
Estimated Operator Cost | 0 (0%) |
Estimated I/O Cost | 0 |
Estimated CPU Cost | 0 |
Estimated Subtree Cost | 0.0401799 |
Estimated Number of Executions | 1 |
Estimated Number of Rows | 1 |
Estimated Row Size | 27 B |
Node ID | 0 |
Output List
Union1006
Expr1010
Stream Aggregate
(Aggregate)
Cost: 0%
Stream Aggregate
Compute summary values for groups of rows in a suitably sorted stream.
Physical Operation | Stream Aggregate |
---|---|
Logical Operation | Aggregate |
Actual Execution Mode | Row |
Estimated Execution Mode | Row |
Actual Number of Rows | 1 |
Actual Number of Batches | 0 |
Estimated Operator Cost | 0.0000017 (0%) |
Estimated I/O Cost | 0 |
Estimated CPU Cost | 0.0000017 |
Estimated Subtree Cost | 0.0401799 |
Estimated Number of Executions | 1 |
Number of Executions | 1 |
Estimated Number of Rows | 1 |
Estimated Row Size | 27 B |
Actual Rebinds | 0 |
Actual Rewinds | 0 |
Node ID | 1 |
Output List
Union1006
Expr1031
Expr1032
Merge Join
(Concatenation)
Cost: 14%
Merge Join
Physical Operation | Merge Join |
---|---|
Logical Operation | Concatenation |
Actual Execution Mode | Row |
Estimated Execution Mode | Row |
Actual Number of Rows | 2 |
Actual Number of Batches | 0 |
Estimated Operator Cost | 0.0056024 (14%) |
Estimated I/O Cost | 0 |
Estimated CPU Cost | 0.0056023 |
Estimated Subtree Cost | 0.0401782 |
Estimated Number of Executions | 1 |
Number of Executions | 1 |
Estimated Number of Rows | 2 |
Estimated Row Size | 27 B |
Actual Rebinds | 0 |
Actual Rewinds | 0 |
Node ID | 2 |
Output List
Union1006
Expr1009
Compute Scalar
Cost: 0%
Compute Scalar
Compute new values from existing values in a row.
Physical Operation | Compute Scalar |
---|---|
Logical Operation | Compute Scalar |
Estimated Execution Mode | Row |
Estimated Operator Cost | 0 (0%) |
Estimated I/O Cost | 0 |
Estimated CPU Cost | 0 |
Estimated Subtree Cost | 0.0172879 |
Estimated Number of Executions | 1 |
Estimated Number of Rows | 1 |
Estimated Row Size | 27 B |
Node ID | 3 |
Output List
[fiddle_39398e1c57fb4473b9d0fcd05ec4720b].[dbo].[SalesLedger].Date
Expr1009
Stream Aggregate
(Aggregate)
Cost: 4%
Stream Aggregate
Compute summary values for groups of rows in a suitably sorted stream.
Physical Operation | Stream Aggregate |
---|---|
Logical Operation | Aggregate |
Actual Execution Mode | Row |
Estimated Execution Mode | Row |
Actual Number of Rows | 1 |
Actual Number of Batches | 0 |
Estimated Operator Cost | 0.0015449 (4%) |
Estimated I/O Cost | 0 |
Estimated CPU Cost | 0.0015449 |
Estimated Subtree Cost | 0.0172879 |
Estimated Number of Executions | 1 |
Number of Executions | 1 |
Estimated Number of Rows | 1 |
Estimated Row Size | 27 B |
Actual Rebinds | 0 |
Actual Rewinds | 0 |
Node ID | 4 |
Output List
[fiddle_39398e1c57fb4473b9d0fcd05ec4720b].[dbo].[SalesLedger].Date
Expr1027
Expr1028
Index Scan (NonClustered)
[SalesLedger].[IX]
Cost: 39%
Index Scan (NonClustered)
Physical Operation | Index Scan |
---|---|
Logical Operation | Index Scan |
Actual Execution Mode | Row |
Estimated Execution Mode | Row |
Storage | RowStore |
Number of Rows Read | 2574 |
Actual Number of Rows | 2574 |
Actual Number of Batches | 0 |
Estimated Operator Cost | 0.015743 (39%) |
Estimated I/O Cost | 0.0127546 |
Estimated CPU Cost | 0.0029884 |
Estimated Subtree Cost | 0.015743 |
Estimated Number of Executions | 1 |
Number of Executions | 1 |
Estimated Number of Rows to be Read | 2574 |
Estimated Number of Rows | 2574 |
Estimated Row Size | 27 B |
Actual Rebinds | 0 |
Actual Rewinds | 0 |
Ordered | True |
Node ID | 5 |
Output List
[fiddle_39398e1c57fb4473b9d0fcd05ec4720b].[dbo].[SalesLedger].Date
[fiddle_39398e1c57fb4473b9d0fcd05ec4720b].[dbo].[SalesLedger].Total
Object
[fiddle_39398e1c57fb4473b9d0fcd05ec4720b].[dbo].[SalesLedger].[IX]
Compute Scalar
Cost: 0%
Compute Scalar
Compute new values from existing values in a row.
Physical Operation | Compute Scalar |
---|---|
Logical Operation | Compute Scalar |
Estimated Execution Mode | Row |
Estimated Operator Cost | 0 (0%) |
Estimated I/O Cost | 0 |
Estimated CPU Cost | 0 |
Estimated Subtree Cost | 0.0172879 |
Estimated Number of Executions | 1 |
Estimated Number of Rows | 1 |
Estimated Row Size | 27 B |
Node ID | 6 |
Output List
[fiddle_39398e1c57fb4473b9d0fcd05ec4720b].[dbo].[Purchases].Date
Expr1009
Stream Aggregate
(Aggregate)
Cost: 4%
Stream Aggregate
Compute summary values for groups of rows in a suitably sorted stream.
Physical Operation | Stream Aggregate |
---|---|
Logical Operation | Aggregate |
Actual Execution Mode | Row |
Estimated Execution Mode | Row |
Actual Number of Rows | 1 |
Actual Number of Batches | 0 |
Estimated Operator Cost | 0.0015449 (4%) |
Estimated I/O Cost | 0 |
Estimated CPU Cost | 0.0015449 |
Estimated Subtree Cost | 0.0172879 |
Estimated Number of Executions | 1 |
Number of Executions | 1 |
Estimated Number of Rows | 1 |
Estimated Row Size | 27 B |
Actual Rebinds | 0 |
Actual Rewinds | 0 |
Node ID | 7 |
Output List
[fiddle_39398e1c57fb4473b9d0fcd05ec4720b].[dbo].[Purchases].Date
Expr1029
Expr1030
Index Scan (NonClustered)
[Purchases].[IX]
Cost: 39%
Index Scan (NonClustered)
Physical Operation | Index Scan |
---|---|
Logical Operation | Index Scan |
Actual Execution Mode | Row |
Estimated Execution Mode | Row |
Storage | RowStore |
Number of Rows Read | 2574 |
Actual Number of Rows | 2574 |
Actual Number of Batches | 0 |
Estimated Operator Cost | 0.015743 (39%) |
Estimated I/O Cost | 0.0127546 |
Estimated CPU Cost | 0.0029884 |
Estimated Subtree Cost | 0.015743 |
Estimated Number of Executions | 1 |
Number of Executions | 1 |
Estimated Number of Rows to be Read | 2574 |
Estimated Number of Rows | 2574 |
Estimated Row Size | 27 B |
Actual Rebinds | 0 |
Actual Rewinds | 0 |
Ordered | True |
Node ID | 8 |
Output List
[fiddle_39398e1c57fb4473b9d0fcd05ec4720b].[dbo].[Purchases].Date
[fiddle_39398e1c57fb4473b9d0fcd05ec4720b].[dbo].[Purchases].Total
Object
[fiddle_39398e1c57fb4473b9d0fcd05ec4720b].[dbo].[Purchases].[IX]