53,000,000 rows count result but profiler query shows only 115,000 reads. Trying to understand why.

  • 53,000,000 rows in a table according to 'select count (*) from table'

    When examining the profiler i can see this query has logged 115,000 reads (0 writes expected).

    Was expecting 53,000,000 reads. Why does the Profiler not show this ?

    Please note this is the first time this query was run in say 16 hours. Guess its possible its cached.

    If this is the case, if i start stop SQL server to clear the cache then run the same query , could i expect 53,000,000 reads ?

    Even if its using an index i would have expected many reads.

    Thanks you in advance for any explication.

    Scott

  • The 'reads' value is the number of 8k pages read not the number of rows.



    Clear Sky SQL
    My Blog[/url]

  • Dave Ballantyne (11/4/2010)


    The 'reads' value is the number of 8k pages read not the number of rows.

    Ah i see , thanks for posting.

  • One more important detail. The SAME page can be read multiple times in that total. So even if the whole table has only 5 pages, the total reads for that table can be 500. One obvious example is an exists clause or subquery.

Viewing 4 posts - 1 through 3 (of 3 total)

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