Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2003
    Location
    Milano, Italy
    Posts
    80

    Unanswered: Profiler vs SET STATISTICS IO / TIME

    This morning i was profiling two queries to see if the changes i've done were improving it.

    So i firstly used the usual SET STATISTIC IO ON.

    This is the result on the First and the Second queries:

    Code:
    (681 row(s) affected)
    
    Table 'WEB_NewsletterSubscription'. Scan count 2724, logical reads 5452, physical reads 0, read-ahead reads 0.
    Table 'WEB_ProductRegistration'. Scan count 2724, logical reads 5456, physical reads 0, read-ahead reads 0.
    Table 'WEB_Journalist'. Scan count 2724, logical reads 5456, physical reads 0, read-ahead reads 0.
    Table 'WEB_User'. Scan count 4, logical reads 292, physical reads 0, read-ahead reads 0.
    
    (681 row(s) affected)
    
    Table 'WEB_NewsletterSubscription'. Scan count 2076, logical reads 4335, physical reads 0, read-ahead reads 0.
    Table 'WEB_ProductRegistration'. Scan count 2043, logical reads 4231, physical reads 0, read-ahead reads 0.
    Table 'WEB_Journalist'. Scan count 2043, logical reads 4092, physical reads 0, read-ahead reads 0.
    Table 'WEB_User'. Scan count 3, logical reads 219, physical reads 0, read-ahead reads 0.
    From what I see i say that the Second is better.

    So switched to profiler to be ever sure, and got this:

    Code:
    Event Class						CPU	Reads	Writes	Dur.
    SQL:BatchCompleted SQL Query Analyzer	***	***	100	4189	0	130	1948	57	2004-09-02 12:02:38.493	
    SQL:BatchCompleted SQL Query Analyzer	***	***	150	4486	0	170	1948	57	2004-09-02 12:02:38.623
    WHAT!??!
    Now seems that the First is better!!!!

    Who's joking me? Why two different reponses? Who is more reliable?
    Davide Mauri
    http://www.davidemauri.it

  2. #2
    Join Date
    Aug 2004
    Posts
    5
    okay. what are you using for comparison to determine which is better?

  3. #3
    Join Date
    Feb 2003
    Location
    Milano, Italy
    Posts
    80
    Scan count + logical reads for STATISTIC and READS for the Profiler.
    Davide Mauri
    http://www.davidemauri.it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •