clear markdown compare help best fiddles feedback dbanow.uk
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 2591595 fiddles created (45744 in the last week).

DROP TABLE IF EXISTS dbo.logger_data, dbo.logger, dbo.[group], dbo.categories;
 hidden batch(es)


CREATE TABLE dbo.categories ( id uniqueidentifier NOT NULL CONSTRAINT [UQ dbo.categories id] UNIQUE NONCLUSTERED, [name] nvarchar(50) NOT NULL CONSTRAINT [PK dbo.categories name] PRIMARY KEY CLUSTERED ); -- Choose a better name for this table CREATE TABLE dbo.[group] ( id uniqueidentifier NOT NULL CONSTRAINT [PK dbo.group id] PRIMARY KEY CLUSTERED ); CREATE TABLE dbo.logger ( id uniqueidentifier CONSTRAINT [UQ dbo.logger id] UNIQUE NONCLUSTERED, group_id uniqueidentifier NOT NULL CONSTRAINT [FK dbo.group id] FOREIGN KEY (group_id) REFERENCES [dbo].[group] (id), uuid char(17) NOT NULL CONSTRAINT [PK dbo.logger uuid] PRIMARY KEY CLUSTERED ); CREATE TABLE dbo.logger_data ( id uniqueidentifier CONSTRAINT [PK dbo.logger_data id] PRIMARY KEY NONCLUSTERED, logger_uuid char(17) NOT NULL CONSTRAINT [FK dbo.logger_data uuid] FOREIGN KEY (logger_uuid) REFERENCES dbo.logger (uuid), category_name nvarchar(50) NOT NULL CONSTRAINT [dbo.logger_data name] FOREIGN KEY (category_name) REFERENCES dbo.categories ([name]), recorded_on datetime NOT NULL, INDEX [dbo.logger_data logger_uuid recorded_on] CLUSTERED (logger_uuid, recorded_on) );
 hidden batch(es)


SET NOCOUNT ON; INSERT INTO categories (id, name) VALUES ('974b0fee-66eb-49f8-ae7f-2cddd0eb7571', 'category_a'); INSERT INTO categories (id, name) VALUES ('30f4dec8-8cc5-42c2-9f6d-9a790ab26ae1', 'category_b'); INSERT INTO categories (id, name) VALUES ('aa7b1395-7def-4e6c-afe0-84468cb51172', 'category_c'); INSERT INTO [group] (id) VALUES ('14d8e2c0-3b63-4614-82a4-1311410e427e'); INSERT INTO [group] (id) VALUES ('cb21aee4-1a1d-4edc-a113-a2f715c031b1'); INSERT INTO [group] (id) VALUES ('4670b24d-1057-43ed-9adc-880c3b424df3'); INSERT INTO [group] (id) VALUES ('0033db52-5285-472c-a589-ec3f19c63ebb'); INSERT INTO logger (id, group_id, uuid) VALUES ('a93c974a-d512-4a26-8c0e-4b51f473211c', '14d8e2c0-3b63-4614-82a4-1311410e427e', 'logger1'); INSERT INTO logger (id, group_id, uuid) VALUES ('6146f1ba-a880-4cfd-b6ff-7bf2c8d181ef', 'cb21aee4-1a1d-4edc-a113-a2f715c031b1', 'logger2'); INSERT INTO logger (id, group_id, uuid) VALUES ('04a000d6-985f-41e4-b4bc-97371920c1f4', 'cb21aee4-1a1d-4edc-a113-a2f715c031b1', 'logger3'); INSERT INTO logger (id, group_id, uuid) VALUES ('3c971a32-5c88-466b-94de-e1310fb71c38', '4670b24d-1057-43ed-9adc-880c3b424df3', 'logger4'); INSERT INTO logger (id, group_id, uuid) VALUES ('0cfabc8e-711a-4f4d-8439-1f9f0ef6fee4', '0033db52-5285-472c-a589-ec3f19c63ebb', 'logger5'); INSERT INTO logger (id, group_id, uuid) VALUES ('8aa0e4d6-3dce-4127-9bbd-d2b041cb1bb0', '4670b24d-1057-43ed-9adc-880c3b424df3', 'logger6'); INSERT INTO logger (id, group_id, uuid) VALUES ('300aadbc-7237-4033-b0e4-349c2850ffca', '0033db52-5285-472c-a589-ec3f19c63ebb', 'logger7'); INSERT INTO logger_data (id, logger_uuid, category_name, recorded_on) VALUES ('70e34017-3a16-4524-b72d-30048ba306c5', 'logger1', 'category_a', '2018-02-01 11:50:00'); INSERT INTO logger_data (id, logger_uuid, category_name, recorded_on) VALUES ('e9fd273b-a87a-46f8-8e2c-7f305cbe86d1', 'logger2', 'category_a', '2018-02-01 11:51:00'); INSERT INTO logger_data (id, logger_uuid, category_name, recorded_on) VALUES ('c1a4bd24-7ee6-4bd8-889b-b71f15129c53', 'logger3', 'category_a', '2018-02-01 11:52:00'); INSERT INTO logger_data (id, logger_uuid, category_name, recorded_on) VALUES ('d95561d2-02e0-42f1-bed6-aba5006bdb9d', 'logger4', 'category_a', '2018-02-01 11:53:00'); INSERT INTO logger_data (id, logger_uuid, category_name, recorded_on) VALUES ('ad09b542-252f-4234-85a2-3e0c5d7f2920', 'logger1', 'category_a', '2018-02-01 11:54:00'); INSERT INTO logger_data (id, logger_uuid, category_name, recorded_on) VALUES ('cd2b3508-47e4-4fc4-b01d-0a565da728db', 'logger5', 'category_b', '2018-02-01 11:55:00'); INSERT INTO logger_data (id, logger_uuid, category_name, recorded_on) VALUES ('f20b0140-68f4-4455-8d1d-14f9cae04123', 'logger5', 'category_b', '2018-02-01 11:56:00'); INSERT INTO logger_data (id, logger_uuid, category_name, recorded_on) VALUES ('bcee99ad-509c-436c-b720-ff73755c82c3', 'logger6', 'category_b', '2018-02-01 11:57:00'); INSERT INTO logger_data (id, logger_uuid, category_name, recorded_on) VALUES ('e9395838-02a8-4e74-99b0-9a02414b265d', 'logger6', 'category_b', '2018-02-01 11:58:00'); INSERT INTO logger_data (id, logger_uuid, category_name, recorded_on) VALUES ('fac4543e-5eca-4748-adf2-bffa50fa8b99', 'logger7', 'category_c', '2018-02-01 11:59:00'); INSERT INTO logger_data (id, logger_uuid, category_name, recorded_on) VALUES ('7b5a9ed3-1d2b-42af-be2c-2cec4437e4f6', 'logger7', 'category_c', '2018-02-01 11:59:00'); INSERT INTO logger_data (id, logger_uuid, category_name, recorded_on) VALUES ('07d73818-e68e-4504-9f5a-fbde98f5ceb2', 'logger5', 'category_c', '2018-02-01 11:59:00'); SET NOCOUNT OFF;
 hidden batch(es)


set statistics xml on; SELECT category_id = C.id, logger_group_count = COUNT_BIG(DISTINCT L.group_id) FROM dbo.logger AS L CROSS APPLY ( -- Latest reading per logger SELECT TOP (1) LD.recorded_on, LD.category_name FROM dbo.logger_data AS LD WHERE LD.logger_uuid = L.uuid ORDER BY LD.recorded_on DESC ) AS LDT1 JOIN dbo.categories AS C ON C.[name] = LDT1.category_name GROUP BY C.id ORDER BY C.id;
category_id logger_group_count
974b0fee-66eb-49f8-ae7f-2cddd0eb7571 3
aa7b1395-7def-4e6c-afe0-84468cb51172 1
30f4dec8-8cc5-42c2-9f6d-9a790ab26ae1 1
Microsoft SQL Server 2005 XML Showplan
<ShowPlanXML xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan" Version="1.481" Build="14.0.3192.2"><BatchSequence><Batch><Statements><StmtSimple StatementText="SELECT &#xa; category_id = C.id, &#xa; logger_group_count = COUNT_BIG(DISTINCT L.group_id)&#xa;FROM dbo.logger AS L&#xa;CROSS APPLY &#xa;(&#xa; -- Latest reading per logger&#xa; SELECT TOP (1) &#xa; LD.recorded_on,&#xa; LD.category_name&#xa; FROM dbo.logger_data AS LD&#xa; WHERE LD.logger_uuid = L.uuid&#xa; ORDER BY &#xa; LD.recorded_on DESC&#xa;) AS LDT1&#xa;JOIN dbo.categories AS C&#xa; ON C.[name] = LDT1.category_name&#xa;GROUP BY&#xa; C.id&#xa;ORDER BY&#xa; C.id" StatementId="1" StatementCompId="2" StatementType="SELECT" RetrievedFromCache="true" StatementSubTreeCost="0.0232072" StatementEstRows="1" SecurityPolicyApplied="false" StatementOptmLevel="FULL" QueryHash="0x261092D62BF37C17" QueryPlanHash="0xC9BA41FAF4BCA806" StatementOptmEarlyAbortReason="GoodEnoughPlanFound" CardinalityEstimationModelVersion="140"><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" MemoryGrant="1024" NonParallelPlanReason="NoParallelPlansInDesktopOrExpressEdition" CachedPlanSize="32" CompileTime="15" CompileCPU="0" CompileMemory="312"><MemoryGrantInfo SerialRequiredMemory="512" SerialDesiredMemory="544" RequiredMemory="512" DesiredMemory="544" RequestedMemory="1024" GrantWaitTime="0" GrantedMemory="1024" MaxUsedMemory="16" MaxQueryMemory="975648"></MemoryGrantInfo><OptimizerHardwareDependentProperties EstimatedAvailableMemoryGrant="838808" EstimatedPagesCached="52425" EstimatedAvailableDegreeOfParallelism="1" MaxCompileMemory="3254656"></OptimizerHardwareDependentProperties><OptimizerStatsUsage><StatisticsInfo LastUpdate="2019-10-14T15:17:19.54" ModificationCount="0" SamplingPercent="100" Statistics="[UQ dbo.logger id]" Table="[logger]" Schema="[dbo]" Database="[fiddle_b27ed7c3bfd54d77985dd9d58837190a]"></StatisticsInfo><StatisticsInfo LastUpdate="2019-10-14T15:17:19.54" ModificationCount="0" SamplingPercent="100" Statistics="[PK dbo.categories name]" Table="[categories]" Schema="[dbo]" Database="[fiddle_b27ed7c3bfd54d77985dd9d58837190a]"></StatisticsInfo><StatisticsInfo LastUpdate="2019-10-14T15:17:19.53" ModificationCount="0" SamplingPercent="100" Statistics="[dbo.logger_data logger_uuid recorded_on]" Table="[logger_data]" Schema="[dbo]" Database="[fiddle_b27ed7c3bfd54d77985dd9d58837190a]"></StatisticsInfo><StatisticsInfo LastUpdate="2019-10-14T15:17:19.53" ModificationCount="0" SamplingPercent="100" Statistics="[_WA_Sys_00000003_3D5E1FD2]" Table="[logger_data]" Schema="[dbo]" Database="[fiddle_b27ed7c3bfd54d77985dd9d58837190a]"></StatisticsInfo><StatisticsInfo LastUpdate="2019-10-14T15:17:19.54" ModificationCount="0" SamplingPercent="100" Statistics="[_WA_Sys_00000002_398D8EEE]" Table="[logger]" Schema="[dbo]" Database="[fiddle_b27ed7c3bfd54d77985dd9d58837190a]"></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="Stream Aggregate" LogicalOp="Aggregate" EstimateRows="1" EstimateIO="0" EstimateCPU="2.9e-006" AvgRowSize="31" EstimatedTotalSubtreeCost="0.0232072" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_b27ed7c3bfd54d77985dd9d58837190a]" Schema="[dbo]" Table="[categories]" Alias="[C]" Column="id"></ColumnReference><ColumnReference Column="Expr1004"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="3" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualEndOfScans="1" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><StreamAggregate><DefinedValues><DefinedValue><ColumnReference Column="Expr1004"></ColumnReference><ScalarOperator ScalarString="Count(*)"><Aggregate AggType="countstar" Distinct="0"></Aggregate></ScalarOperator></DefinedValue></DefinedValues><GroupBy><ColumnReference Database="[fiddle_b27ed7c3bfd54d77985dd9d58837190a]" Schema="[dbo]" Table="[categories]" Alias="[C]" Column="id"></ColumnReference></GroupBy><RelOp NodeId="1" PhysicalOp="Sort" LogicalOp="Distinct Sort" EstimateRows="4" EstimateIO="0.0112613" EstimateCPU="0.000130695" AvgRowSize="39" EstimatedTotalSubtreeCost="0.0232043" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_b27ed7c3bfd54d77985dd9d58837190a]" Schema="[dbo]" Table="[logger]" Alias="[L]" Column="group_id"></ColumnReference><ColumnReference Database="[fiddle_b27ed7c3bfd54d77985dd9d58837190a]" Schema="[dbo]" Table="[categories]" Alias="[C]" Column="id"></ColumnReference></OutputList><MemoryFractions Input="1" Output="1"></MemoryFractions><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="5" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualScans="0" ActualLogicalReads="0" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRebinds="1" ActualRewinds="0" ActualEndOfScans="1" ActualExecutions="1" InputMemoryGrant="1024" OutputMemoryGrant="640" UsedMemoryGrant="16"></RunTimeCountersPerThread></RunTimeInformation><Sort Distinct="1"><OrderBy><OrderByColumn Ascending="1"><ColumnReference Database="[fiddle_b27ed7c3bfd54d77985dd9d58837190a]" Schema="[dbo]" Table="[categories]" Alias="[C]" Column="id"></ColumnReference></OrderByColumn><OrderByColumn Ascending="1"><ColumnReference Database="[fiddle_b27ed7c3bfd54d77985dd9d58837190a]" Schema="[dbo]" Table="[logger]" Alias="[L]" Column="group_id"></ColumnReference></OrderByColumn></OrderBy><RelOp NodeId="2" PhysicalOp="Nested Loops" LogicalOp="Inner Join" EstimateRows="7" EstimateIO="0" EstimateCPU="2.926e-005" AvgRowSize="39" EstimatedTotalSubtreeCost="0.0118123" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_b27ed7c3bfd54d77985dd9d58837190a]" Schema="[dbo]" Table="[logger]" Alias="[L]" Column="group_id"></ColumnReference><ColumnReference Database="[fiddle_b27ed7c3bfd54d77985dd9d58837190a]" Schema="[dbo]" Table="[categories]" Alias="[C]" Column="id"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="7" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualEndOfScans="1" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><NestedLoops Optimized="0"><OuterReferences><ColumnReference Database="[fiddle_b27ed7c3bfd54d77985dd9d58837190a]" Schema="[dbo]" Table="[logger_data]" Alias="[LD]" Column="category_name"></ColumnReference></OuterReferences><RelOp NodeId="3" PhysicalOp="Nested Loops" LogicalOp="Inner Join" EstimateRows="7" EstimateIO="0" EstimateCPU="2.926e-005" AvgRowSize="47" EstimatedTotalSubtreeCost="0.00755136" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_b27ed7c3bfd54d77985dd9d58837190a]" Schema="[dbo]" Table="[logger]" Alias="[L]" Column="group_id"></ColumnReference><ColumnReference Database="[fiddle_b27ed7c3bfd54d77985dd9d58837190a]" Schema="[dbo]" Table="[logger_data]" Alias="[LD]" Column="category_name"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="7" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualEndOfScans="1" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><NestedLoops Optimized="0"><OuterReferences><ColumnReference Database="[fiddle_b27ed7c3bfd54d77985dd9d58837190a]" Schema="[dbo]" Table="[logger]" Alias="[L]" Column="uuid"></ColumnReference></OuterReferences><RelOp NodeId="4" PhysicalOp="Clustered Index Scan" LogicalOp="Clustered Index Scan" EstimateRows="7" EstimatedRowsRead="7" EstimateIO="0.003125" EstimateCPU="0.0001647" AvgRowSize="40" EstimatedTotalSubtreeCost="0.0032897" TableCardinality="7" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_b27ed7c3bfd54d77985dd9d58837190a]" Schema="[dbo]" Table="[logger]" Alias="[L]" Column="group_id"></ColumnReference><ColumnReference Database="[fiddle_b27ed7c3bfd54d77985dd9d58837190a]" Schema="[dbo]" Table="[logger]" Alias="[L]" Column="uuid"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="7" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualScans="1" ActualLogicalReads="2" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRowsRead="7" ActualEndOfScans="1" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><IndexScan Ordered="0" ForcedIndex="0" ForceScan="0" NoExpandHint="0" Storage="RowStore"><DefinedValues><DefinedValue><ColumnReference Database="[fiddle_b27ed7c3bfd54d77985dd9d58837190a]" Schema="[dbo]" Table="[logger]" Alias="[L]" Column="group_id"></ColumnReference></DefinedValue><DefinedValue><ColumnReference Database="[fiddle_b27ed7c3bfd54d77985dd9d58837190a]" Schema="[dbo]" Table="[logger]" Alias="[L]" Column="uuid"></ColumnReference></DefinedValue></DefinedValues><Object Database="[fiddle_b27ed7c3bfd54d77985dd9d58837190a]" Schema="[dbo]" Table="[logger]" Index="[PK dbo.logger uuid]" Alias="[L]" IndexKind="Clustered" Storage="RowStore"></Object></IndexScan></RelOp><RelOp NodeId="5" PhysicalOp="Top" LogicalOp="Top" EstimateRows="1" EstimateIO="0" EstimateCPU="1e-007" AvgRowSize="31" EstimatedTotalSubtreeCost="0.0042324" Parallel="0" EstimateRebinds="6" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_b27ed7c3bfd54d77985dd9d58837190a]" Schema="[dbo]" Table="[logger_data]" Alias="[LD]" Column="category_name"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="7" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualEndOfScans="0" ActualExecutions="7"></RunTimeCountersPerThread></RunTimeInformation><Top RowCount="0" IsPercent="0" WithTies="0"><TopExpression><ScalarOperator ScalarString="(1)"><Const ConstValue="(1)"></Const></ScalarOperator></TopExpression><RelOp NodeId="6" PhysicalOp="Clustered Index Seek" LogicalOp="Clustered Index Seek" EstimateRows="1" EstimateRowsWithoutRowGoal="1.71429" EstimatedRowsRead="1.71429" EstimateIO="0.003125" EstimateCPU="0.000158886" AvgRowSize="39" EstimatedTotalSubtreeCost="0.0042317" TableCardinality="12" Parallel="0" EstimateRebinds="6" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_b27ed7c3bfd54d77985dd9d58837190a]" Schema="[dbo]" Table="[logger_data]" Alias="[LD]" Column="category_name"></ColumnReference><ColumnReference Database="[fiddle_b27ed7c3bfd54d77985dd9d58837190a]" Schema="[dbo]" Table="[logger_data]" Alias="[LD]" Column="recorded_on"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="7" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualScans="7" ActualLogicalReads="14" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRowsRead="7" ActualEndOfScans="0" ActualExecutions="7"></RunTimeCountersPerThread></RunTimeInformation><IndexScan Ordered="1" ScanDirection="BACKWARD" ForcedIndex="0" ForceSeek="0" ForceScan="0" NoExpandHint="0" Storage="RowStore"><DefinedValues><DefinedValue><ColumnReference Database="[fiddle_b27ed7c3bfd54d77985dd9d58837190a]" Schema="[dbo]" Table="[logger_data]" Alias="[LD]" Column="category_name"></ColumnReference></DefinedValue><DefinedValue><ColumnReference Database="[fiddle_b27ed7c3bfd54d77985dd9d58837190a]" Schema="[dbo]" Table="[logger_data]" Alias="[LD]" Column="recorded_on"></ColumnReference></DefinedValue></DefinedValues><Object Database="[fiddle_b27ed7c3bfd54d77985dd9d58837190a]" Schema="[dbo]" Table="[logger_data]" Index="[dbo.logger_data logger_uuid recorded_on]" Alias="[LD]" IndexKind="Clustered" Storage="RowStore"></Object><SeekPredicates><SeekPredicateNew><SeekKeys><Prefix ScanType="EQ"><RangeColumns><ColumnReference Database="[fiddle_b27ed7c3bfd54d77985dd9d58837190a]" Schema="[dbo]" Table="[logger_data]" Alias="[LD]" Column="logger_uuid"></ColumnReference></RangeColumns><RangeExpressions><ScalarOperator ScalarString="[fiddle_b27ed7c3bfd54d77985dd9d58837190a].[dbo].[logger].[uuid] as [L].[uuid]"><Identifier><ColumnReference Database="[fiddle_b27ed7c3bfd54d77985dd9d58837190a]" Schema="[dbo]" Table="[logger]" Alias="[L]" Column="uuid"></ColumnReference></Identifier></ScalarOperator></RangeExpressions></Prefix></SeekKeys></SeekPredicateNew></SeekPredicates></IndexScan></RelOp></Top></RelOp></NestedLoops></RelOp><RelOp NodeId="7" PhysicalOp="Clustered Index Seek" LogicalOp="Clustered Index Seek" EstimateRows="1" EstimatedRowsRead="1" EstimateIO="0.003125" EstimateCPU="0.0001581" AvgRowSize="23" EstimatedTotalSubtreeCost="0.0042317" TableCardinality="3" Parallel="0" EstimateRebinds="0" EstimateRewinds="6" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_b27ed7c3bfd54d77985dd9d58837190a]" Schema="[dbo]" Table="[categories]" Alias="[C]" Column="id"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="7" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualScans="0" ActualLogicalReads="14" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRowsRead="7" ActualEndOfScans="0" ActualExecutions="7"></RunTimeCountersPerThread></RunTimeInformation><IndexScan Ordered="1" ScanDirection="FORWARD" ForcedIndex="0" ForceSeek="0" ForceScan="0" NoExpandHint="0" Storage="RowStore"><DefinedValues><DefinedValue><ColumnReference Database="[fiddle_b27ed7c3bfd54d77985dd9d58837190a]" Schema="[dbo]" Table="[categories]" Alias="[C]" Column="id"></ColumnReference></DefinedValue></DefinedValues><Object Database="[fiddle_b27ed7c3bfd54d77985dd9d58837190a]" Schema="[dbo]" Table="[categories]" Index="[PK dbo.categories name]" Alias="[C]" IndexKind="Clustered" Storage="RowStore"></Object><SeekPredicates><SeekPredicateNew><SeekKeys><Prefix ScanType="EQ"><RangeColumns><ColumnReference Database="[fiddle_b27ed7c3bfd54d77985dd9d58837190a]" Schema="[dbo]" Table="[categories]" Alias="[C]" Column="name"></ColumnReference></RangeColumns><RangeExpressions><ScalarOperator ScalarString="[fiddle_b27ed7c3bfd54d77985dd9d58837190a].[dbo].[logger_data].[category_name] as [LD].[category_name]"><Identifier><ColumnReference Database="[fiddle_b27ed7c3bfd54d77985dd9d58837190a]" Schema="[dbo]" Table="[logger_data]" Alias="[LD]" Column="category_name"></ColumnReference></Identifier></ScalarOperator></RangeExpressions></Prefix></SeekKeys></SeekPredicateNew></SeekPredicates></IndexScan></RelOp></NestedLoops></RelOp></Sort></RelOp></StreamAggregate></RelOp></QueryPlan></StmtSimple></Statements></Batch></BatchSequence></ShowPlanXML>
 hidden batch(es)