Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid numbers for Scan count / Total logical #55

Open
h0wXD opened this issue Nov 19, 2021 · 0 comments
Open

Invalid numbers for Scan count / Total logical #55

h0wXD opened this issue Nov 19, 2021 · 0 comments

Comments

@h0wXD
Copy link

h0wXD commented Nov 19, 2021

When I run a single query that selects from a view, it returns multiple Worktable entries in statistics:
select * from vw_.... OPTION (MAXDOP 1)

SQL Server 15.0.4178.1

Output being:

 SQL Server Execution Times:
   CPU time = 0 ms,  elapsed time = 0 ms.
SQL Server parse and compile time: 
   CPU time = 2250 ms, elapsed time = 2253 ms.

(74116 rows affected)
Table 'Worktable'. Scan count 0, logical reads 0, physical reads 0, page server reads 0, read-ahead reads 0, page server read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob page server reads 0, lob read-ahead reads 0, lob page server read-ahead reads 0.
Table 'Worktable'. Scan count 157568, logical reads 632302, physical reads 0, page server reads 0, read-ahead reads 0, page server read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob page server reads 0, lob read-ahead reads 0, lob page server read-ahead reads 0.

(1 row affected)

 SQL Server Execution Times:
   CPU time = 8469 ms,  elapsed time = 10099 ms.
SQL Server parse and compile time: 
   CPU time = 0 ms, elapsed time = 0 ms.

 SQL Server Execution Times:
   CPU time = 0 ms,  elapsed time = 0 ms.

Completion time: 2021-11-19T14:23:02.1595887+08:00

The totals should be Scan count 157568, logical reads 632302.
However https://statisticsparser.com/ reports Scan count 315,136 and logical reads 1,264,604, duplicating the numbers

image

This only seems to happen to individual query blocks, as the totals (on the bottom of the page) is correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant