Skip to content

Instantly share code, notes, and snippets.

@timgabrhel

timgabrhel/executionplan2.xml Secret

Created Dec 4, 2019
Embed
What would you like to do?
executionplan2
<?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.539" Build="15.0.1900.210" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan">
<BatchSequence>
<Batch>
<Statements>
<StmtSimple StatementCompId="3" StatementEstRows="7.12741" StatementId="1" StatementOptmLevel="FULL" CardinalityEstimationModelVersion="140" StatementSubTreeCost="4.3582" StatementText="WITH cte AS (&#xD;&#xA; SELECT&#xD;&#xA; ROW_NUMBER() OVER (ORDER BY SendDate DESC) AS RowNum, &#xD;&#xA; MT.MessageThreadId, &#xD;&#xA; MT.FromUserHasArchived, &#xD;&#xA; MT.ToUserHasArchived, &#xD;&#xA; MT.Created, &#xD;&#xA; MT.ThreadStartedBy, &#xD;&#xA; MT.ThreadSentTo, &#xD;&#xA; MT.[Subject], &#xD;&#xA; MT.CanReply, &#xD;&#xA; MT.FromUserDeleted, &#xD;&#xA; MT.ToUserDeleted, &#xD;&#xA; LM.MessageId, &#xD;&#xA; LM.Deleted, &#xD;&#xA; LM.FromUserId, &#xD;&#xA; LM.ToUserId, &#xD;&#xA; LM.[Message], &#xD;&#xA; LM.SendDate, &#xD;&#xA; LM.ReadDate&#xD;&#xA; FROM MessageThreads MT &#xD;&#xA; -- join the most recent non-deleted message where this user is the sender or receiver&#xD;&#xA; LEFT OUTER JOIN &#xD;&#xA; (&#xD;&#xA; SELECT RANK() OVER (PARTITION BY MessageThreadId ORDER BY SendDate DESC) r, * &#xD;&#xA; FROM [Messages] &#xD;&#xA; WHERE (FromUserId=@UserId OR ToUserId=@UserId) &#xD;&#xA; AND (Deleted=0)&#xD;&#xA; ) LM ON (LM.MessageThreadId = MT.MessageThreadId AND LM.r = 1) &#xD;&#xA; WHERE MT.ThreadSentTo=@UserId OR MT.ThreadStartedBy=@UserId &#xD;&#xA;)&#xD;&#xA;SELECT&#xD;&#xA; cte.*,&#xD;&#xA; UserFrom.FirstName AS UserFromFirstName, &#xD;&#xA; UserFrom.LastName AS UserFromLastName, &#xD;&#xA; UserFrom.Email AS UserFromEmail, &#xD;&#xA; UserTo.FirstName AS UserToFirstName, &#xD;&#xA; UserTo.LastName AS UserToLastName, &#xD;&#xA; UserTo.Email AS UserToEmail &#xD;&#xA;FROM cte&#xD;&#xA;LEFT OUTER JOIN Users AS UserFrom ON cte.FromUserId=UserFrom.UserId &#xD;&#xA;LEFT OUTER JOIN Users AS UserTo ON cte.ToUserId=UserTo.UserId &#xD;&#xA;WHERE RowNum &gt;= 1 &#xD;&#xA;AND RowNum &lt;= 11 &#xD;&#xA;ORDER BY RowNum ASC" StatementType="SELECT" QueryHash="0x56D4EA9F525D7E16" QueryPlanHash="0xADF6182720A6BE76" RetrievedFromCache="true" StatementSqlHandle="0x0900FA605ABE7A06F1138720ABABD3EB4C830000000000000000000000000000000000000000000000000000" DatabaseContextSettingsId="19" ParentObjectId="0" StatementParameterizationType="0" SecurityPolicyApplied="false">
<StatementSetOptions ANSI_NULLS="true" ANSI_PADDING="true" ANSI_WARNINGS="true" ARITHABORT="false" CONCAT_NULL_YIELDS_NULL="true" NUMERIC_ROUNDABORT="false" QUOTED_IDENTIFIER="true" />
<QueryPlan DegreeOfParallelism="1" MemoryGrant="3360" CachedPlanSize="136" CompileTime="18" CompileCPU="18" CompileMemory="1464">
<MemoryGrantInfo SerialRequiredMemory="1280" SerialDesiredMemory="3360" RequiredMemory="1280" DesiredMemory="3360" RequestedMemory="3360" GrantWaitTime="0" GrantedMemory="3360" MaxUsedMemory="2848" MaxQueryMemory="5293704" />
<OptimizerHardwareDependentProperties EstimatedAvailableMemoryGrant="7549739" EstimatedPagesCached="2831152" EstimatedAvailableDegreeOfParallelism="3" MaxCompileMemory="15308472" />
<OptimizerStatsUsage>
<StatisticsInfo Database="[2b885f52-9dfb-4bd4-8f23-e7301f9d4bfb]" Schema="[dbo]" Table="[Users]" Statistics="[PK_Users]" ModificationCount="3100" SamplingPercent="30.0915" LastUpdate="2019-09-17T19:34:55.42" />
<StatisticsInfo Database="[2b885f52-9dfb-4bd4-8f23-e7301f9d4bfb]" Schema="[dbo]" Table="[Messages]" Statistics="[_WA_Sys_00000008_7C1A6C5A]" ModificationCount="18832" SamplingPercent="3.5025" LastUpdate="2019-11-22T03:07:15.59" />
<StatisticsInfo Database="[2b885f52-9dfb-4bd4-8f23-e7301f9d4bfb]" Schema="[dbo]" Table="[Messages]" Statistics="[nci_wi_Messages_9AB8B9D5FFD025E77AAB65C886618783]" ModificationCount="3932" SamplingPercent="3.22623" LastUpdate="2019-12-02T18:19:23.85" />
<StatisticsInfo Database="[2b885f52-9dfb-4bd4-8f23-e7301f9d4bfb]" Schema="[dbo]" Table="[Messages]" Statistics="[IX_ToUserId_Deleted_Includes]" ModificationCount="3143" SamplingPercent="100" LastUpdate="2019-12-03T04:22:35.33" />
<StatisticsInfo Database="[2b885f52-9dfb-4bd4-8f23-e7301f9d4bfb]" Schema="[dbo]" Table="[MessageThreads]" Statistics="[_WA_Sys_00000005_2A164134]" ModificationCount="15168" SamplingPercent="24.7257" LastUpdate="2019-11-15T20:52:36.18" />
<StatisticsInfo Database="[2b885f52-9dfb-4bd4-8f23-e7301f9d4bfb]" Schema="[dbo]" Table="[MessageThreads]" Statistics="[_WA_Sys_00000006_2A164134]" ModificationCount="15168" SamplingPercent="24.7257" LastUpdate="2019-11-15T20:52:36.32" />
<StatisticsInfo Database="[2b885f52-9dfb-4bd4-8f23-e7301f9d4bfb]" Schema="[dbo]" Table="[Messages]" Statistics="[PK_Messages]" ModificationCount="17722" SamplingPercent="2.90605" LastUpdate="2019-11-19T20:13:31.87" />
<StatisticsInfo Database="[2b885f52-9dfb-4bd4-8f23-e7301f9d4bfb]" Schema="[dbo]" Table="[Messages]" Statistics="[ix_Messages_ToUserId_ReadDate_Deleted]" ModificationCount="18068" SamplingPercent="3.21637" LastUpdate="2019-11-19T17:39:12.17" />
<StatisticsInfo Database="[2b885f52-9dfb-4bd4-8f23-e7301f9d4bfb]" Schema="[dbo]" Table="[Messages]" Statistics="[_WA_Sys_00000003_7C1A6C5A]" ModificationCount="1539" SamplingPercent="3.16692" LastUpdate="2019-12-04T06:32:40.33" />
<StatisticsInfo Database="[2b885f52-9dfb-4bd4-8f23-e7301f9d4bfb]" Schema="[dbo]" Table="[Messages]" Statistics="[ix_Messages_MessageThreadId]" ModificationCount="18062" SamplingPercent="3.21635" LastUpdate="2019-11-19T17:44:07.96" />
<StatisticsInfo Database="[2b885f52-9dfb-4bd4-8f23-e7301f9d4bfb]" Schema="[dbo]" Table="[MessageThreads]" Statistics="[PK_MessageThreads]" ModificationCount="16824" SamplingPercent="25.5104" LastUpdate="2019-10-30T21:51:48.75" />
</OptimizerStatsUsage>
<WaitStats>
<Wait WaitType="IO_COMPLETION" WaitTimeMs="412" WaitCount="1325" />
<Wait WaitType="MEMORY_ALLOCATION_EXT" WaitTimeMs="5" WaitCount="2672" />
<Wait WaitType="RESERVED_MEMORY_ALLOCATION_EXT" WaitTimeMs="2" WaitCount="908" />
<Wait WaitType="SOS_SCHEDULER_YIELD" WaitTimeMs="1" WaitCount="134" />
</WaitStats>
<QueryTimeStats CpuTime="2684" ElapsedTime="17767" />
<RelOp AvgRowSize="4357" EstimateCPU="2.97926E-05" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="7.12741" LogicalOp="Left Outer Join" NodeId="0" Parallel="false" PhysicalOp="Nested Loops" EstimatedTotalSubtreeCost="4.3582">
<OutputList>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="MessageThreadId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="FromUserHasArchived" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ToUserHasArchived" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="Created" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ThreadStartedBy" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ThreadSentTo" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="Subject" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="CanReply" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="FromUserDeleted" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ToUserDeleted" />
<ColumnReference Column="Expr1005" />
<ColumnReference Column="Expr1007" />
<ColumnReference Column="Expr1008" />
<ColumnReference Column="Expr1009" />
<ColumnReference Column="Expr1010" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="SendDate" />
<ColumnReference Column="Expr1012" />
<ColumnReference Column="Expr1013" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Users]" Alias="[UserFrom]" Column="Email" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Users]" Alias="[UserFrom]" Column="FirstName" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Users]" Alias="[UserFrom]" Column="LastName" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Users]" Alias="[UserTo]" Column="Email" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Users]" Alias="[UserTo]" Column="FirstName" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Users]" Alias="[UserTo]" Column="LastName" />
</OutputList>
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRows="11" Batches="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row" ActualElapsedms="17766" ActualCPUms="2683" />
</RunTimeInformation>
<NestedLoops Optimized="false">
<OuterReferences>
<ColumnReference Column="Expr1009" />
</OuterReferences>
<RelOp AvgRowSize="4251" EstimateCPU="2.97926E-05" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="7.12741" LogicalOp="Left Outer Join" NodeId="1" Parallel="false" PhysicalOp="Nested Loops" EstimatedTotalSubtreeCost="4.35391">
<OutputList>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="MessageThreadId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="FromUserHasArchived" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ToUserHasArchived" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="Created" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ThreadStartedBy" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ThreadSentTo" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="Subject" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="CanReply" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="FromUserDeleted" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ToUserDeleted" />
<ColumnReference Column="Expr1005" />
<ColumnReference Column="Expr1007" />
<ColumnReference Column="Expr1008" />
<ColumnReference Column="Expr1009" />
<ColumnReference Column="Expr1010" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="SendDate" />
<ColumnReference Column="Expr1012" />
<ColumnReference Column="Expr1013" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Users]" Alias="[UserFrom]" Column="Email" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Users]" Alias="[UserFrom]" Column="FirstName" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Users]" Alias="[UserFrom]" Column="LastName" />
</OutputList>
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRows="11" Batches="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row" ActualElapsedms="17766" ActualCPUms="2683" />
</RunTimeInformation>
<NestedLoops Optimized="false">
<OuterReferences>
<ColumnReference Column="Expr1008" />
</OuterReferences>
<RelOp AvgRowSize="4145" EstimateCPU="6.96902E-05" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="7.12741" LogicalOp="Filter" NodeId="2" Parallel="false" PhysicalOp="Filter" EstimatedTotalSubtreeCost="4.34963">
<OutputList>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="MessageThreadId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="FromUserHasArchived" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ToUserHasArchived" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="Created" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ThreadStartedBy" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ThreadSentTo" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="Subject" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="CanReply" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="FromUserDeleted" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ToUserDeleted" />
<ColumnReference Column="Expr1005" />
<ColumnReference Column="Expr1007" />
<ColumnReference Column="Expr1008" />
<ColumnReference Column="Expr1009" />
<ColumnReference Column="Expr1010" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="SendDate" />
<ColumnReference Column="Expr1012" />
<ColumnReference Column="Expr1013" />
</OutputList>
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRows="11" Batches="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row" ActualElapsedms="17766" ActualCPUms="2683" />
</RunTimeInformation>
<Filter StartupExpression="false">
<RelOp AvgRowSize="4145" EstimateCPU="7.91934E-06" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="79.1934" LogicalOp="Top" NodeId="3" Parallel="false" PhysicalOp="Top" EstimatedTotalSubtreeCost="4.34956">
<OutputList>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="MessageThreadId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="FromUserHasArchived" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ToUserHasArchived" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="Created" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ThreadStartedBy" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ThreadSentTo" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="Subject" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="CanReply" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="FromUserDeleted" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ToUserDeleted" />
<ColumnReference Column="Expr1005" />
<ColumnReference Column="Expr1007" />
<ColumnReference Column="Expr1008" />
<ColumnReference Column="Expr1009" />
<ColumnReference Column="Expr1010" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="SendDate" />
<ColumnReference Column="Expr1012" />
<ColumnReference Column="Expr1013" />
</OutputList>
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRows="11" Batches="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row" ActualElapsedms="17766" ActualCPUms="2683" />
</RunTimeInformation>
<Top RowCount="false" IsPercent="false" WithTies="false">
<TopExpression>
<ScalarOperator ScalarString="CASE WHEN (11) IS NULL OR (11)&lt;(0) THEN (0) ELSE (11) END">
<IF>
<Condition>
<ScalarOperator>
<Logical Operation="OR">
<ScalarOperator>
<Compare CompareOp="IS">
<ScalarOperator>
<Const ConstValue="(11)" />
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="NULL" />
</ScalarOperator>
</Compare>
</ScalarOperator>
<ScalarOperator>
<Compare CompareOp="LT">
<ScalarOperator>
<Const ConstValue="(11)" />
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="(0)" />
</ScalarOperator>
</Compare>
</ScalarOperator>
</Logical>
</ScalarOperator>
</Condition>
<Then>
<ScalarOperator>
<Const ConstValue="(0)" />
</ScalarOperator>
</Then>
<Else>
<ScalarOperator>
<Const ConstValue="(11)" />
</ScalarOperator>
</Else>
</IF>
</ScalarOperator>
</TopExpression>
<RelOp AvgRowSize="4145" EstimateCPU="6.33547E-06" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="79.1934" LogicalOp="Compute Scalar" NodeId="4" Parallel="false" PhysicalOp="Sequence Project" EstimatedTotalSubtreeCost="4.34955">
<OutputList>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="MessageThreadId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="FromUserHasArchived" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ToUserHasArchived" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="Created" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ThreadStartedBy" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ThreadSentTo" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="Subject" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="CanReply" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="FromUserDeleted" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ToUserDeleted" />
<ColumnReference Column="Expr1005" />
<ColumnReference Column="Expr1007" />
<ColumnReference Column="Expr1008" />
<ColumnReference Column="Expr1009" />
<ColumnReference Column="Expr1010" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="SendDate" />
<ColumnReference Column="Expr1012" />
<ColumnReference Column="Expr1013" />
</OutputList>
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRows="11" Batches="0" ActualEndOfScans="0" ActualExecutions="1" ActualExecutionMode="Row" ActualElapsedms="17766" ActualCPUms="2683" />
</RunTimeInformation>
<SequenceProject>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1013" />
<ScalarOperator ScalarString="row_number">
<Sequence FunctionName="row_number" />
</ScalarOperator>
</DefinedValue>
</DefinedValues>
<RelOp AvgRowSize="4145" EstimateCPU="1.58387E-06" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="79.1934" LogicalOp="Segment" NodeId="5" Parallel="false" PhysicalOp="Segment" EstimatedTotalSubtreeCost="4.34955">
<OutputList>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="MessageThreadId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="FromUserHasArchived" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ToUserHasArchived" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="Created" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ThreadStartedBy" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ThreadSentTo" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="Subject" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="CanReply" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="FromUserDeleted" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ToUserDeleted" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="SendDate" />
<ColumnReference Column="Expr1005" />
<ColumnReference Column="Expr1007" />
<ColumnReference Column="Expr1008" />
<ColumnReference Column="Expr1009" />
<ColumnReference Column="Expr1010" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="SendDate" />
<ColumnReference Column="Expr1012" />
<ColumnReference Column="Segment1019" />
</OutputList>
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRows="11" Batches="0" ActualEndOfScans="0" ActualExecutions="1" ActualExecutionMode="Row" ActualElapsedms="17766" ActualCPUms="2683" />
</RunTimeInformation>
<Segment>
<GroupBy />
<SegmentColumn>
<ColumnReference Column="Segment1019" />
</SegmentColumn>
<RelOp AvgRowSize="4145" EstimateCPU="0.000883361" EstimateIO="0.0112613" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="79.1934" LogicalOp="Sort" NodeId="7" Parallel="false" PhysicalOp="Sort" EstimatedTotalSubtreeCost="4.34955">
<OutputList>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="MessageThreadId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="FromUserHasArchived" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ToUserHasArchived" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="Created" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ThreadStartedBy" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ThreadSentTo" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="Subject" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="CanReply" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="FromUserDeleted" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ToUserDeleted" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="SendDate" />
<ColumnReference Column="Expr1005" />
<ColumnReference Column="Expr1007" />
<ColumnReference Column="Expr1008" />
<ColumnReference Column="Expr1009" />
<ColumnReference Column="Expr1010" />
<ColumnReference Column="Expr1012" />
</OutputList>
<Warnings>
<SpillToTempDb SpillLevel="2" SpilledThreadCount="1" />
<SortSpillDetails GrantedMemoryKb="1184" UsedMemoryKb="1184" WritesToTempDb="9628" ReadsFromTempDb="9628" />
</Warnings>
<MemoryFractions Input="0.323077" Output="1" />
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRebinds="1" ActualRewinds="0" ActualRows="11" Batches="0" ActualEndOfScans="0" ActualExecutions="1" ActualExecutionMode="Row" ActualElapsedms="17766" ActualCPUms="2683" ActualScans="0" ActualLogicalReads="0" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" InputMemoryGrant="1184" OutputMemoryGrant="2208" UsedMemoryGrant="1440" />
</RunTimeInformation>
<Sort Distinct="false">
<OrderBy>
<OrderByColumn Ascending="false">
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="SendDate" />
</OrderByColumn>
</OrderBy>
<RelOp AvgRowSize="4145" EstimateCPU="0.00612013" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="79.1934" LogicalOp="Left Outer Join" NodeId="8" Parallel="false" PhysicalOp="Merge Join" EstimatedTotalSubtreeCost="4.3374">
<OutputList>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="MessageThreadId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="FromUserHasArchived" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ToUserHasArchived" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="Created" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ThreadStartedBy" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ThreadSentTo" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="Subject" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="CanReply" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="FromUserDeleted" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ToUserDeleted" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="SendDate" />
<ColumnReference Column="Expr1005" />
<ColumnReference Column="Expr1007" />
<ColumnReference Column="Expr1008" />
<ColumnReference Column="Expr1009" />
<ColumnReference Column="Expr1010" />
<ColumnReference Column="Expr1011" />
<ColumnReference Column="Expr1012" />
</OutputList>
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRows="16459" Batches="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row" ActualElapsedms="13709" ActualCPUms="2174" ActualScans="0" ActualLogicalReads="0" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" />
</RunTimeInformation>
<Merge ManyToMany="false">
<InnerSideJoinColumns>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="MessageThreadId" />
</InnerSideJoinColumns>
<OuterSideJoinColumns>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="MessageThreadId" />
</OuterSideJoinColumns>
<Residual>
<ScalarOperator ScalarString="[mydatabase].[dbo].[MessageThreads].[MessageThreadId] as [MT].[MessageThreadId]=[mydatabase].[dbo].[Messages].[MessageThreadId]">
<Compare CompareOp="EQ">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="MessageThreadId" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="MessageThreadId" />
</Identifier>
</ScalarOperator>
</Compare>
</ScalarOperator>
</Residual>
<RelOp AvgRowSize="70" EstimateCPU="0.000879263" EstimateIO="0.0112613" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="79.1915" LogicalOp="Sort" NodeId="9" Parallel="false" PhysicalOp="Sort" EstimatedTotalSubtreeCost="3.72597">
<OutputList>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="MessageThreadId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="FromUserHasArchived" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ToUserHasArchived" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="Created" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ThreadStartedBy" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ThreadSentTo" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="Subject" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="CanReply" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="FromUserDeleted" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ToUserDeleted" />
</OutputList>
<Warnings>
<SpillToTempDb SpillLevel="1" SpilledThreadCount="1" />
<SortSpillDetails GrantedMemoryKb="2592" UsedMemoryKb="2080" WritesToTempDb="133" ReadsFromTempDb="133" />
</Warnings>
<MemoryFractions Input="1" Output="0.0153846" />
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRebinds="1" ActualRewinds="0" ActualRows="16459" Batches="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row" ActualElapsedms="223" ActualCPUms="159" ActualScans="0" ActualLogicalReads="0" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" InputMemoryGrant="2592" OutputMemoryGrant="160" UsedMemoryGrant="2080" />
</RunTimeInformation>
<Sort Distinct="false">
<OrderBy>
<OrderByColumn Ascending="true">
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="MessageThreadId" />
</OrderByColumn>
</OrderBy>
<RelOp AvgRowSize="70" EstimateCPU="0.439764" EstimateIO="2.92238" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="79.1915" EstimatedRowsRead="399643" LogicalOp="Index Scan" NodeId="10" Parallel="false" PhysicalOp="Index Scan" EstimatedTotalSubtreeCost="3.36215" TableCardinality="399643">
<OutputList>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="MessageThreadId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="FromUserHasArchived" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ToUserHasArchived" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="Created" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ThreadStartedBy" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ThreadSentTo" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="Subject" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="CanReply" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="FromUserDeleted" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ToUserDeleted" />
</OutputList>
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRows="16459" ActualRowsRead="399645" Batches="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row" ActualElapsedms="130" ActualCPUms="130" ActualScans="1" ActualLogicalReads="3954" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" />
</RunTimeInformation>
<IndexScan Ordered="false" ForcedIndex="false" ForceSeek="false" ForceScan="false" NoExpandHint="false" Storage="RowStore">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="MessageThreadId" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="FromUserHasArchived" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ToUserHasArchived" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="Created" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ThreadStartedBy" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ThreadSentTo" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="Subject" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="CanReply" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="FromUserDeleted" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ToUserDeleted" />
</DefinedValue>
</DefinedValues>
<Object Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Index="[nci_wi_MessageThreads_4AE42CECCF44AA0519F913BAF59A3CFA]" Alias="[MT]" IndexKind="NonClustered" Storage="RowStore" />
<Predicate>
<ScalarOperator ScalarString="[mydatabase].[dbo].[MessageThreads].[ThreadSentTo] as [MT].[ThreadSentTo]=[@UserId] OR [mydatabase].[dbo].[MessageThreads].[ThreadStartedBy] as [MT].[ThreadStartedBy]=[@UserId]">
<Logical Operation="OR">
<ScalarOperator>
<Compare CompareOp="EQ">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ThreadSentTo" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Column="@UserId" />
</Identifier>
</ScalarOperator>
</Compare>
</ScalarOperator>
<ScalarOperator>
<Compare CompareOp="EQ">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[MessageThreads]" Alias="[MT]" Column="ThreadStartedBy" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Column="@UserId" />
</Identifier>
</ScalarOperator>
</Compare>
</ScalarOperator>
</Logical>
</ScalarOperator>
</Predicate>
</IndexScan>
</RelOp>
</Sort>
</RelOp>
<RelOp AvgRowSize="4093" EstimateCPU="7.90651E-05" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="164.719" LogicalOp="Filter" NodeId="11" Parallel="false" PhysicalOp="Filter" EstimatedTotalSubtreeCost="0.605304">
<OutputList>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="MessageThreadId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="SendDate" />
<ColumnReference Column="Expr1005" />
<ColumnReference Column="Expr1007" />
<ColumnReference Column="Expr1008" />
<ColumnReference Column="Expr1009" />
<ColumnReference Column="Expr1010" />
<ColumnReference Column="Expr1011" />
<ColumnReference Column="Expr1012" />
</OutputList>
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRows="16453" Batches="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row" ActualElapsedms="13474" ActualCPUms="2003" />
</RunTimeInformation>
<Filter StartupExpression="false">
<RelOp AvgRowSize="4101" EstimateCPU="1.64719E-05" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="164.719" LogicalOp="Compute Scalar" NodeId="12" Parallel="false" PhysicalOp="Compute Scalar" EstimatedTotalSubtreeCost="0.605225">
<OutputList>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="MessageThreadId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="SendDate" />
<ColumnReference Column="Expr1003" />
<ColumnReference Column="Expr1005" />
<ColumnReference Column="Expr1007" />
<ColumnReference Column="Expr1008" />
<ColumnReference Column="Expr1009" />
<ColumnReference Column="Expr1010" />
<ColumnReference Column="Expr1011" />
<ColumnReference Column="Expr1012" />
</OutputList>
<ComputeScalar>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1005" />
<ScalarOperator ScalarString="[mydatabase].[dbo].[Messages].[MessageId]">
<Identifier>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="MessageId" />
</Identifier>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1007" />
<ScalarOperator ScalarString="[mydatabase].[dbo].[Messages].[Deleted]">
<Identifier>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="Deleted" />
</Identifier>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1008" />
<ScalarOperator ScalarString="[mydatabase].[dbo].[Messages].[FromUserId]">
<Identifier>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="FromUserId" />
</Identifier>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1009" />
<ScalarOperator ScalarString="[mydatabase].[dbo].[Messages].[ToUserId]">
<Identifier>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="ToUserId" />
</Identifier>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1010" />
<ScalarOperator ScalarString="[mydatabase].[dbo].[Messages].[Message]">
<Identifier>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="Message" />
</Identifier>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1011" />
<ScalarOperator ScalarString="[mydatabase].[dbo].[Messages].[SendDate]">
<Identifier>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="SendDate" />
</Identifier>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1012" />
<ScalarOperator ScalarString="[mydatabase].[dbo].[Messages].[ReadDate]">
<Identifier>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="ReadDate" />
</Identifier>
</ScalarOperator>
</DefinedValue>
</DefinedValues>
<RelOp AvgRowSize="4093" EstimateCPU="9.88314E-06" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="164.719" LogicalOp="Compute Scalar" NodeId="13" Parallel="false" PhysicalOp="Sequence Project" EstimatedTotalSubtreeCost="0.605209">
<OutputList>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="MessageId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="MessageThreadId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="Deleted" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="FromUserId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="ToUserId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="Message" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="SendDate" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="ReadDate" />
<ColumnReference Column="Expr1003" />
</OutputList>
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRows="44939" Batches="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row" ActualElapsedms="13462" ActualCPUms="1991" />
</RunTimeInformation>
<SequenceProject>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1003" />
<ScalarOperator ScalarString="rank">
<Sequence FunctionName="rank" />
</ScalarOperator>
</DefinedValue>
</DefinedValues>
<RelOp AvgRowSize="4093" EstimateCPU="3.29438E-06" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="164.719" LogicalOp="Segment" NodeId="14" Parallel="false" PhysicalOp="Segment" EstimatedTotalSubtreeCost="0.605199">
<OutputList>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="MessageId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="MessageThreadId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="Deleted" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="FromUserId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="ToUserId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="Message" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="SendDate" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="ReadDate" />
<ColumnReference Column="Segment1017" />
<ColumnReference Column="Segment1018" />
</OutputList>
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRows="44939" Batches="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row" ActualElapsedms="13444" ActualCPUms="1973" />
</RunTimeInformation>
<Segment>
<GroupBy>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="MessageThreadId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="SendDate" />
</GroupBy>
<SegmentColumn>
<ColumnReference Column="Segment1018" />
</SegmentColumn>
<RelOp AvgRowSize="4093" EstimateCPU="3.29438E-06" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="164.719" LogicalOp="Segment" NodeId="15" Parallel="false" PhysicalOp="Segment" EstimatedTotalSubtreeCost="0.605196">
<OutputList>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="MessageId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="MessageThreadId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="Deleted" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="FromUserId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="ToUserId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="Message" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="SendDate" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="ReadDate" />
<ColumnReference Column="Segment1017" />
</OutputList>
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRows="44939" Batches="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row" ActualElapsedms="13427" ActualCPUms="1956" />
</RunTimeInformation>
<Segment>
<GroupBy>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="MessageThreadId" />
</GroupBy>
<SegmentColumn>
<ColumnReference Column="Segment1017" />
</SegmentColumn>
<RelOp AvgRowSize="4084" EstimateCPU="0.00199631" EstimateIO="0.0112613" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="164.719" LogicalOp="Sort" NodeId="16" Parallel="false" PhysicalOp="Sort" EstimatedTotalSubtreeCost="0.605192">
<OutputList>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="MessageId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="MessageThreadId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="Deleted" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="FromUserId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="ToUserId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="Message" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="SendDate" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="ReadDate" />
</OutputList>
<Warnings>
<SpillToTempDb SpillLevel="2" SpilledThreadCount="1" />
<SortSpillDetails GrantedMemoryKb="1856" UsedMemoryKb="1856" WritesToTempDb="25757" ReadsFromTempDb="25757" />
</Warnings>
<MemoryFractions Input="0.646154" Output="0.661538" />
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRebinds="1" ActualRewinds="0" ActualRows="44939" Batches="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row" ActualElapsedms="13411" ActualCPUms="1940" ActualScans="0" ActualLogicalReads="0" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" InputMemoryGrant="1856" OutputMemoryGrant="1504" UsedMemoryGrant="1856" />
</RunTimeInformation>
<Sort Distinct="false">
<OrderBy>
<OrderByColumn Ascending="true">
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="MessageThreadId" />
</OrderByColumn>
<OrderByColumn Ascending="false">
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="SendDate" />
</OrderByColumn>
</OrderBy>
<RelOp AvgRowSize="4084" EstimateCPU="0.000688147" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="164.719" LogicalOp="Inner Join" NodeId="17" Parallel="false" PhysicalOp="Nested Loops" EstimatedTotalSubtreeCost="0.591935">
<OutputList>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="MessageId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="MessageThreadId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="Deleted" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="FromUserId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="ToUserId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="Message" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="SendDate" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="ReadDate" />
</OutputList>
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRows="44939" Batches="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row" ActualElapsedms="483" ActualCPUms="355" />
</RunTimeInformation>
<NestedLoops Optimized="false" WithUnorderedPrefetch="true">
<OuterReferences>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="MessageId" />
<ColumnReference Column="Expr1016" />
</OuterReferences>
<RelOp AvgRowSize="32" EstimateCPU="0.00248919" EstimateIO="0.0112613" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="164.628" LogicalOp="Distinct Sort" NodeId="19" Parallel="false" PhysicalOp="Sort" EstimatedTotalSubtreeCost="0.0540024">
<OutputList>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="MessageId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="Deleted" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="ToUserId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="ReadDate" />
</OutputList>
<Warnings>
<SpillToTempDb SpillLevel="2" SpilledThreadCount="1" />
<SortSpillDetails GrantedMemoryKb="1888" UsedMemoryKb="1888" WritesToTempDb="357" ReadsFromTempDb="357" />
</Warnings>
<MemoryFractions Input="0.661538" Output="0.0153846" />
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRebinds="1" ActualRewinds="0" ActualRows="44939" Batches="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row" ActualElapsedms="243" ActualCPUms="116" ActualScans="0" ActualLogicalReads="0" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" InputMemoryGrant="1888" OutputMemoryGrant="160" UsedMemoryGrant="1888" />
</RunTimeInformation>
<Sort Distinct="true">
<OrderBy>
<OrderByColumn Ascending="true">
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="MessageId" />
</OrderByColumn>
</OrderBy>
<RelOp AvgRowSize="32" EstimateCPU="2.00302E-05" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="200.302" LogicalOp="Concatenation" NodeId="20" Parallel="false" PhysicalOp="Concatenation" EstimatedTotalSubtreeCost="0.0402519">
<OutputList>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="MessageId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="Deleted" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="ToUserId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="ReadDate" />
</OutputList>
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRows="44939" Batches="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row" ActualElapsedms="48" ActualCPUms="48" />
</RunTimeInformation>
<Concat>
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="MessageId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="MessageId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="MessageId" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="Deleted" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="Deleted" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="Deleted" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="ToUserId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="ToUserId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="ToUserId" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="ReadDate" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="ReadDate" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="ReadDate" />
</DefinedValue>
</DefinedValues>
<RelOp AvgRowSize="32" EstimateCPU="0.000298851" EstimateIO="0.0365382" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="128.955" EstimatedRowsRead="128.955" LogicalOp="Index Seek" NodeId="21" Parallel="false" PhysicalOp="Index Seek" EstimatedTotalSubtreeCost="0.0368371" TableCardinality="1049350">
<OutputList>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="MessageId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="Deleted" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="ToUserId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="ReadDate" />
</OutputList>
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRows="22032" ActualRowsRead="22032" Batches="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row" ActualElapsedms="23" ActualCPUms="23" ActualScans="1" ActualLogicalReads="10215" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" />
</RunTimeInformation>
<IndexScan Ordered="true" ScanDirection="FORWARD" ForcedIndex="false" ForceSeek="false" ForceScan="false" NoExpandHint="false" Storage="RowStore">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="MessageId" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="Deleted" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="ToUserId" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="ReadDate" />
</DefinedValue>
</DefinedValues>
<Object Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Index="[nci_wi_Messages_9AB8B9D5FFD025E77AAB65C886618783]" IndexKind="NonClustered" Storage="RowStore" />
<SeekPredicates>
<SeekPredicateNew>
<SeekKeys>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="FromUserId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="Deleted" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="[@UserId]">
<Identifier>
<ColumnReference Column="@UserId" />
</Identifier>
</ScalarOperator>
<ScalarOperator ScalarString="(0)">
<Const ConstValue="(0)" />
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekKeys>
</SeekPredicateNew>
</SeekPredicates>
</IndexScan>
</RelOp>
<RelOp AvgRowSize="32" EstimateCPU="0.000235571" EstimateIO="0.003125" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="71.3463" EstimatedRowsRead="71.4281" LogicalOp="Index Seek" NodeId="22" Parallel="false" PhysicalOp="Index Seek" EstimatedTotalSubtreeCost="0.00336057" TableCardinality="1049350">
<OutputList>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="MessageId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="Deleted" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="ToUserId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="ReadDate" />
</OutputList>
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRows="22907" ActualRowsRead="22927" Batches="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row" ActualElapsedms="12" ActualCPUms="12" ActualScans="1" ActualLogicalReads="230" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" />
</RunTimeInformation>
<IndexScan Ordered="true" ScanDirection="FORWARD" ForcedIndex="false" ForceSeek="false" ForceScan="false" NoExpandHint="false" Storage="RowStore">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="MessageId" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="Deleted" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="ToUserId" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="ReadDate" />
</DefinedValue>
</DefinedValues>
<Object Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Index="[ix_Messages_ToUserId_ReadDate_Deleted]" IndexKind="NonClustered" Storage="RowStore" />
<SeekPredicates>
<SeekPredicateNew>
<SeekKeys>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="ToUserId" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="[@UserId]">
<Identifier>
<ColumnReference Column="@UserId" />
</Identifier>
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekKeys>
</SeekPredicateNew>
</SeekPredicates>
<Predicate>
<ScalarOperator ScalarString="[mydatabase].[dbo].[Messages].[Deleted]=(0)">
<Compare CompareOp="EQ">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="Deleted" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="(0)" />
</ScalarOperator>
</Compare>
</ScalarOperator>
</Predicate>
</IndexScan>
</RelOp>
</Concat>
</RelOp>
</Sort>
</RelOp>
<RelOp AvgRowSize="4059" EstimateCPU="0.0001581" EstimateIO="0.003125" EstimateRebinds="163.628" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" LogicalOp="Clustered Index Seek" NodeId="24" Parallel="false" PhysicalOp="Clustered Index Seek" EstimatedTotalSubtreeCost="0.537244" TableCardinality="1049350">
<OutputList>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="MessageThreadId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="FromUserId" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="Message" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="SendDate" />
</OutputList>
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRows="44939" ActualRowsRead="44939" Batches="0" ActualEndOfScans="0" ActualExecutions="44939" ActualExecutionMode="Row" ActualElapsedms="172" ActualCPUms="172" ActualScans="0" ActualLogicalReads="171305" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" />
</RunTimeInformation>
<IndexScan Lookup="true" Ordered="true" ScanDirection="FORWARD" ForcedIndex="false" ForceSeek="false" ForceScan="false" NoExpandHint="false" Storage="RowStore">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="MessageThreadId" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="FromUserId" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="Message" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="SendDate" />
</DefinedValue>
</DefinedValues>
<Object Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Index="[PK_Messages]" TableReferenceId="-1" IndexKind="Clustered" Storage="RowStore" />
<SeekPredicates>
<SeekPredicateNew>
<SeekKeys>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="MessageId" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="[mydatabase].[dbo].[Messages].[MessageId]">
<Identifier>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Messages]" Column="MessageId" />
</Identifier>
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekKeys>
</SeekPredicateNew>
</SeekPredicates>
</IndexScan>
</RelOp>
</NestedLoops>
</RelOp>
</Sort>
</RelOp>
</Segment>
</RelOp>
</Segment>
</RelOp>
</SequenceProject>
</RelOp>
</ComputeScalar>
</RelOp>
<Predicate>
<ScalarOperator ScalarString="[Expr1003]=(1)">
<Compare CompareOp="EQ">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1003" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="(1)" />
</ScalarOperator>
</Compare>
</ScalarOperator>
</Predicate>
</Filter>
</RelOp>
</Merge>
</RelOp>
</Sort>
</RelOp>
</Segment>
</RelOp>
</SequenceProject>
</RelOp>
</Top>
</RelOp>
<Predicate>
<ScalarOperator ScalarString="[Expr1013]&gt;=(1) AND [Expr1013]&lt;=(11)">
<Logical Operation="AND">
<ScalarOperator>
<Compare CompareOp="GE">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1013" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="(1)" />
</ScalarOperator>
</Compare>
</ScalarOperator>
<ScalarOperator>
<Compare CompareOp="LE">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1013" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="(11)" />
</ScalarOperator>
</Compare>
</ScalarOperator>
</Logical>
</ScalarOperator>
</Predicate>
</Filter>
</RelOp>
<RelOp AvgRowSize="115" EstimateCPU="0.0001581" EstimateIO="0.003125" EstimateRebinds="0" EstimateRewinds="6.12741" EstimatedExecutionMode="Row" EstimateRows="1" EstimatedRowsRead="1" LogicalOp="Clustered Index Seek" NodeId="25" Parallel="false" PhysicalOp="Clustered Index Seek" EstimatedTotalSubtreeCost="0.00425184" TableCardinality="31480">
<OutputList>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Users]" Alias="[UserFrom]" Column="Email" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Users]" Alias="[UserFrom]" Column="FirstName" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Users]" Alias="[UserFrom]" Column="LastName" />
</OutputList>
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRows="11" ActualRowsRead="11" Batches="0" ActualEndOfScans="0" ActualExecutions="11" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualScans="0" ActualLogicalReads="33" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" />
</RunTimeInformation>
<IndexScan Ordered="true" ScanDirection="FORWARD" ForcedIndex="false" ForceSeek="false" ForceScan="false" NoExpandHint="false" Storage="RowStore">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Users]" Alias="[UserFrom]" Column="Email" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Users]" Alias="[UserFrom]" Column="FirstName" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Users]" Alias="[UserFrom]" Column="LastName" />
</DefinedValue>
</DefinedValues>
<Object Database="[mydatabase]" Schema="[dbo]" Table="[Users]" Index="[PK_Users]" Alias="[UserFrom]" IndexKind="Clustered" Storage="RowStore" />
<SeekPredicates>
<SeekPredicateNew>
<SeekKeys>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Users]" Alias="[UserFrom]" Column="UserId" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="[Expr1008]">
<Identifier>
<ColumnReference Column="Expr1008" />
</Identifier>
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekKeys>
</SeekPredicateNew>
</SeekPredicates>
</IndexScan>
</RelOp>
</NestedLoops>
</RelOp>
<RelOp AvgRowSize="115" EstimateCPU="0.0001581" EstimateIO="0.003125" EstimateRebinds="0" EstimateRewinds="6.12741" EstimatedExecutionMode="Row" EstimateRows="1" EstimatedRowsRead="1" LogicalOp="Clustered Index Seek" NodeId="26" Parallel="false" PhysicalOp="Clustered Index Seek" EstimatedTotalSubtreeCost="0.00425184" TableCardinality="31480">
<OutputList>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Users]" Alias="[UserTo]" Column="Email" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Users]" Alias="[UserTo]" Column="FirstName" />
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Users]" Alias="[UserTo]" Column="LastName" />
</OutputList>
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRows="11" ActualRowsRead="11" Batches="0" ActualEndOfScans="0" ActualExecutions="11" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualScans="0" ActualLogicalReads="33" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" />
</RunTimeInformation>
<IndexScan Ordered="true" ScanDirection="FORWARD" ForcedIndex="false" ForceSeek="false" ForceScan="false" NoExpandHint="false" Storage="RowStore">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Users]" Alias="[UserTo]" Column="Email" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Users]" Alias="[UserTo]" Column="FirstName" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Users]" Alias="[UserTo]" Column="LastName" />
</DefinedValue>
</DefinedValues>
<Object Database="[mydatabase]" Schema="[dbo]" Table="[Users]" Index="[PK_Users]" Alias="[UserTo]" IndexKind="Clustered" Storage="RowStore" />
<SeekPredicates>
<SeekPredicateNew>
<SeekKeys>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[mydatabase]" Schema="[dbo]" Table="[Users]" Alias="[UserTo]" Column="UserId" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="[Expr1009]">
<Identifier>
<ColumnReference Column="Expr1009" />
</Identifier>
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekKeys>
</SeekPredicateNew>
</SeekPredicates>
</IndexScan>
</RelOp>
</NestedLoops>
</RelOp>
<ParameterList>
<ColumnReference Column="@UserId" ParameterDataType="bigint" ParameterRuntimeValue="(1792)" />
</ParameterList>
</QueryPlan>
</StmtSimple>
</Statements>
</Batch>
</BatchSequence>
</ShowPlanXML>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment