Understanding WAIT_TIME_MS Test scenario:
I am only one user on database. I reset sys.dm_os_wait_stats. I run a SELECT query (table scan).

Result:
Execution time = 20 minutes, but sys.dm_os_wait_stats -&gt; PAGEIOLATCH_SH -&gt; Wait_time_ms = 40 minutes (2 580 252)

Question:
How is it possible that in 20 minutes: wait_time_ms &gt; execution time ?
As the two comments mention, there are two things at work here.


sys.dm_os_wait_stats records accumulated wait times since the server was restarted. So if the server has been up for a while, these can be fairly high. To get a meaningful value out of sys.dm_os_wait_stats, you need to take two snapshots e.g. 5 minutes apart and compare them to each other. Keep in mind, there you cannot tie them to a single connection. Anything on the server that is waiting for something during that time will cause a change in one of the values returned by sys.dm_os_wait_stats.
If a query gets executed in parallel, each thread will use up CPU time as well as potentially wait time. So both the total CPU time as well as the total wait time for a single query can be higher than the elapsed time.