Explain Statistics

  • Could someone please give me the definitions for the following:

    Scan count

    logical reads

    physical reads

    read-ahead reads

     

    Also, what would you say about stats that look like this?

    Table 'T_CASE_CLIENT_LAST_PRIMARY_STAFF'. Scan count 1, logical reads 6,318, physical reads 0, read-ahead reads 6,319.

    Table 'TCL_HMRMVL_HIST'. Scan count 1,184, logical reads 837,088, physical reads 0, read-ahead reads 0.

    Table 'Worktable'. Scan count 1,385, logical reads 4,937, physical reads 0, read-ahead reads 0.

    Table 'TTRTMNT_CLIENT'. Scan count 2,368, logical reads 4,662,592, physical reads 0, read-ahead reads 0.

    Table 'TTRTPLAN'. Scan count 2,368, logical reads 4,882,816, physical reads 0, read-ahead reads 0.

    Table 'TCASE'. Scan count 1184, logical reads 3,552, physical reads 455, read-ahead reads 0.

    Table 'TCL_SRVC'. Scan count 1, logical reads 7,719, physical reads 612, read-ahead reads 7719.

    Table 'T_FC_Open'. Scan count 5,221, logical reads 11,676, physical reads 141, read-ahead reads 0.

    Table 'TCL_RELTN'. Scan count 1, logical reads 24,679, physical reads 0, read-ahead reads 24,680.

    Table 'TCL_PRTERMINATION'. Scan count 1, logical reads 137, physical reads 0, read-ahead reads 137.

    Thanks for the help!

  • Scan Count is the number of times SQL Server performs an action on the table e.g. If you have a query that Selects all orders and order details, you may end up with a scan count of 1 for the orders table (because it may read the orders table from start to finish in one go), and a much larger scan count for the order details table (as SQL Server may read the relevant order details rows each time it reads an order)

    Logical reads is the logical number of I/O's SQL Server has performed on that table. They are deemed logical, because the actual data may have been read from the data cache (memory), or from the physical disk.

    Physical reads is the number of I/O's SQL Server has performed on the table, where it has had to read from the disk (rather than finding the data in the cache).

    Read ahead reads happen when SQL Server reads the records before they are actually required, in anticipation of needing to read them later on in the query.

    If my explanation has been any good, then you may be able to work out what is going on with the sample stats you posted.

    My guess is that one of the tables that has a scan count of 1 is the starting point for the query (possibly the 'TCL_PRTERMINATION' table, as it has a fairly low number of I/O's), and the other tables are related to this table.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply