2

I am using:

  • SQL Server Management Studio v18.1
  • SQL Server 2017 CU9
  • AdventureWorks restored from here

Test query:

USE [AdventureWorks];
GO
SELECT TOP (13) *
FROM Sales.SalesOrderHeader AS s 
    INNER JOIN Sales.SalesOrderDetail AS d ON s.SalesOrderID = d.SalesOrderID
WHERE s.TotalDue > 1000
OPTION (RECOMPILE);
GO

Turn on Actual Execution Plan (Ctrl+M). Looking at the 'Clustered Index Seek' I see 13 of 17 (76%). Looking at the properties I see Estimated Number of Rows or Estimated Number of Rows to be Read value is 3.85562. My question is where is this number 17 coming from?

Actual Execution Plan

enter image description here enter image description here

0

1 Answer 1

4

The number 17 comes from the estimated number of rows (per execution) multiplied by the estimated number of executions.

3.85562 * 4.37149  =  16.8548043  ~=  17

In SentryOne Plan Explorer,* we perform the conversion for you, so that estimated rows simply starts at 17, not 3.85562 (I didn't try this specific plan, but that's how the logic in the code should work). I describe the reasoning behind this in this blog post, back when the fix first appeared in Plan Explorer.

*Disclaimer: I work for SentryOne.

1
  • 1
    It does, I just checked. I did not open it in plan explorer (which is my default for any large plan) as I was testing some new features in SSMS. Also I should have notices as this was a nested loop join. Thank you. Jul 23, 2019 at 19:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.