rowcounts different than actual

  • i have a procedure which gives 15 records as output, i also have a trace running simultaneously and i see that "rowcounts" counter for that procedure is 13524. Why is this different? What is it indicating to?

  • sqldba_icon (3/9/2011)


    i have a procedure which gives 15 records as output, i also have a trace running simultaneously and i see that "rowcounts" counter for that procedure is 13524. Why is this different? What is it indicating to?

    "RowCount" in SQL Profiler counts ALL rows that are "touched" or generated internally... not just the rows produced as the final output of the Query.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Jeff Moden (3/9/2011)


    sqldba_icon (3/9/2011)


    i have a procedure which gives 15 records as output, i also have a trace running simultaneously and i see that "rowcounts" counter for that procedure is 13524. Why is this different? What is it indicating to?

    "RowCount" in SQL Profiler counts ALL rows that are "touched" or generated internally... not just the rows produced as the final output of the Query.

    So does "Rowcounts" mean total number of rows "touched" for all the tables inside that proc? Such big difference in actual and total is that a pbm?

  • Not necessarily but, yes, it could be a problem. The only way to know for sure is to look at the execution plan and the code. A GROUP BY on all of the rows of a million row table will likely(should) return a rowcount of about a million even if the result set is only one row. If it's bigger than the table, then you may have a problem.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

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

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