Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Execution Times vs Logical Reads/Scan Count Expand / Collapse
Author
Message
Posted Wednesday, October 30, 2013 3:32 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Sunday, September 21, 2014 2:15 PM
Points: 175, Visits: 515
Hello guys,

I want to discuss about your experience what is better.

for example. I have procedure which has lot of logical reads also I modified
Before
Table 'Worktable'. Scan count 2, logical reads 1477,
Table 'TB_MASTER_MFD01'. Scan count 2, logical reads 40
Table 'TB_REINPUT'. Scan count 2, logical reads 114,
Table 'TB_WORK_ORDER_MFD01'. Scan count 2, logical reads 951,
Table 'TB_MASTER_MFD01'. Scan count 2, logical reads 39
Table 'TB_REINPUT'. Scan count 1, logical reads 33
Table 'TB_WORK_ORDER_MFD01'. Scan count 1, logical reads 948,
CPU time = 31 ms, elapsed time = 43 ms.


After optimize was better
Table 'Worktable'. Scan count 2, logical reads 876,
Table 'TB_MASTER_MFD01'. Scan count 2, logical reads 26
Table 'TB_REINPUT'. Scan count 2, logical reads 37,
Table 'TB_WORK_ORDER_MFD01'. Scan count 2, logical reads 19
Table 'TB_MASTER_MFD01'. Scan count 2, logical reads 24,
Table 'TB_REINPUT'. Scan count 1, logical reads 34,
Table 'TB_WORK_ORDER_MFD01'. Scan count 1, logical reads 14,
SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 8 ms.


But I still investigate the WorkTable, because inside are inside select.. so for this select * from (select ... I use OPTION(RECOMPILE) and result is here
Table 'TB_MASTER_MFD01'. Scan count 7, logical reads 84,
Table 'TB_REINPUT'. Scan count 7, logical reads 14,
Table 'TB_WORK_ORDER_MFD01'. Scan count 2, logical reads 26,
Table 'TB_MASTER_MFD01'. Scan count 2, logical reads 25,
Table 'TB_REINPUT'. Scan count 1, logical reads 34,
Table 'TB_WORK_ORDER_MFD01'. Scan count 1, logical reads 15,
CPU time = 78 ms, elapsed time = 79 ms.



THIS procedure is in timer 1second ..

SO my point is WHAT IS BETTER FROM ANOTHER POINT OF VIEW, I PREFER LONG TIME ( because i think this is still short time ) THAN LOT OF LOGICAL READS, what do you think ?

Thank you for experience and discuss
Post #1509695
Posted Thursday, October 31, 2013 4:40 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Yesterday @ 5:01 AM
Points: 2,840, Visits: 3,968
tony28 (10/30/2013)
SO my point is WHAT IS BETTER FROM ANOTHER POINT OF VIEW, I PREFER LONG TIME ( because i think this is still short time ) THAN LOT OF LOGICAL READS, what do you think ?
Logical reads means data is being read from buffer .. longer time means data (which is not available in buffer) is being read from disk. So what do you want ..every time physical reads (means data from disk ) ? why ?


-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done
Post #1510101
Posted Thursday, November 14, 2013 3:00 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Yesterday @ 2:34 AM
Points: 43, Visits: 512

duplicate post :


http://www.sqlservercentral.com/Forums/Topic1509712-391-1.aspx


===========================================
performance issue:
(1) Have you update the statistics on all tables of underling query?
(2) Are you using index well on the tables?
(3) Can you simplify your Query by re-writing it .
(4) are indexes are Defragmented well ?

Post #1514195
Posted Thursday, November 14, 2013 5:19 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Sunday, September 21, 2014 2:15 PM
Points: 175, Visits: 515
I wanted to delete before, but i dont know where and how.. sorrz for spam
Post #1514227
Posted Thursday, November 14, 2013 6:13 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Yesterday @ 5:01 AM
Points: 2,840, Visits: 3,968
Post cant be deleted.

-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done
Post #1514240
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse