Skip to content

Instantly share code, notes, and snippets.

@SQLkiwi
Created June 10, 2019 18:50
Show Gist options
  • Save SQLkiwi/d9daaa4c01fe0c4fe8ddf8f6bddb1e99 to your computer and use it in GitHub Desktop.
Save SQLkiwi/d9daaa4c01fe0c4fe8ddf8f6bddb1e99 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-16"?>
<ShowPlanXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.535" Build="15.0.1600.8" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan">
<BatchSequence>
<Batch>
<Statements>
<StmtSimple StatementCompId="1" StatementEstRows="1" StatementId="1" StatementOptmLevel="FULL" CardinalityEstimationModelVersion="150" StatementSubTreeCost="696.678" StatementText="SELECT COUNT_BIG(*)&#xD;&#xA;FROM #t&#xD;&#xA;OPTION (MAXDOP 1)" StatementType="SELECT" QueryHash="0x2BB4B13A693C8CD5" QueryPlanHash="0x37EA1BE2B67CABC7" RetrievedFromCache="true" SecurityPolicyApplied="false">
<StatementSetOptions ANSI_NULLS="true" ANSI_PADDING="true" ANSI_WARNINGS="true" ARITHABORT="true" CONCAT_NULL_YIELDS_NULL="true" NUMERIC_ROUNDABORT="false" QUOTED_IDENTIFIER="true" />
<QueryPlan DegreeOfParallelism="0" NonParallelPlanReason="MaxDOPSetToOne" MemoryGrant="3104" CachedPlanSize="24" CompileTime="4" CompileCPU="4" CompileMemory="160">
<MemoryGrantInfo SerialRequiredMemory="3072" SerialDesiredMemory="3104" RequiredMemory="3072" DesiredMemory="3104" RequestedMemory="3104" GrantWaitTime="0" GrantedMemory="3104" MaxUsedMemory="736" MaxQueryMemory="378112" LastRequestedMemory="0" IsMemoryGrantFeedbackAdjusted="No: First Execution" />
<OptimizerHardwareDependentProperties EstimatedAvailableMemoryGrant="52428" EstimatedPagesCached="13107" EstimatedAvailableDegreeOfParallelism="1" MaxCompileMemory="985848" />
<WaitStats>
<Wait WaitType="PAGEIOLATCH_SH" WaitTimeMs="9619" WaitCount="9990" />
<Wait WaitType="SOS_SCHEDULER_YIELD" WaitTimeMs="6312" WaitCount="511" />
<Wait WaitType="MEMORY_ALLOCATION_EXT" WaitTimeMs="485" WaitCount="859148" />
</WaitStats>
<QueryTimeStats CpuTime="6762" ElapsedTime="26449" />
<RelOp AvgRowSize="15" EstimateCPU="0.334511" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Batch" EstimateRows="1" LogicalOp="Aggregate" NodeId="0" Parallel="false" PhysicalOp="Hash Match" EstimatedTotalSubtreeCost="696.678">
<OutputList>
<ColumnReference Column="Expr1003" />
</OutputList>
<MemoryFractions Input="1" Output="1" />
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRows="1" Batches="1" ActualEndOfScans="0" ActualExecutions="1" ActualExecutionMode="Batch" ActualElapsedms="49" ActualCPUms="45" ActualScans="0" ActualLogicalReads="0" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" />
</RunTimeInformation>
<Hash>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1003" />
<ScalarOperator ScalarString="COUNT(*)">
<Aggregate AggType="COUNT*" Distinct="false" />
</ScalarOperator>
</DefinedValue>
</DefinedValues>
<HashKeysBuild />
<RelOp AvgRowSize="9" EstimateCPU="7.16413" EstimateIO="689.179" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Batch" EstimateRows="6512700" EstimatedRowsRead="6512700" LogicalOp="Table Scan" NodeId="1" Parallel="false" PhysicalOp="Table Scan" EstimatedTotalSubtreeCost="696.344" TableCardinality="6512700">
<OutputList />
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRows="6512704" ActualRowsRead="6512704" Batches="7237" ActualEndOfScans="0" ActualExecutions="1" ActualExecutionMode="Batch" ActualElapsedms="26386" ActualCPUms="6700" ActualScans="1" ActualLogicalReads="930389" ActualPhysicalReads="189" ActualReadAheads="930388" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" />
</RunTimeInformation>
<IndexScan Ordered="false" ForcedIndex="false" ForceSeek="false" ForceScan="false" NoExpandHint="false" Storage="RowStore">
<DefinedValues />
<Object Database="[tempdb]" Schema="[dbo]" Table="[#t]" Storage="RowStore" />
</IndexScan>
</RelOp>
</Hash>
</RelOp>
</QueryPlan>
</StmtSimple>
</Statements>
</Batch>
</BatchSequence>
</ShowPlanXML>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment