SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Execution Times vs Logical Reads/Scan Count


Execution Times vs Logical Reads/Scan Count

Author
Message
tony28
tony28
SSChasing Mays
SSChasing Mays (612 reputation)SSChasing Mays (612 reputation)SSChasing Mays (612 reputation)SSChasing Mays (612 reputation)SSChasing Mays (612 reputation)SSChasing Mays (612 reputation)SSChasing Mays (612 reputation)SSChasing Mays (612 reputation)

Group: General Forum Members
Points: 612 Visits: 889
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



How to post data/code on a forum to get the best help: Option 1 / Option 2
Bhuvnesh
Bhuvnesh
SSCertifiable
SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)

Group: General Forum Members
Points: 5186 Visits: 4076
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;-)
tony28
tony28
SSChasing Mays
SSChasing Mays (612 reputation)SSChasing Mays (612 reputation)SSChasing Mays (612 reputation)SSChasing Mays (612 reputation)SSChasing Mays (612 reputation)SSChasing Mays (612 reputation)SSChasing Mays (612 reputation)SSChasing Mays (612 reputation)

Group: General Forum Members
Points: 612 Visits: 889
I wanted to delete before, but i dont know where and how.. sorrz for spam



How to post data/code on a forum to get the best help: Option 1 / Option 2
Bhuvnesh
Bhuvnesh
SSCertifiable
SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)

Group: General Forum Members
Points: 5186 Visits: 4076
Post cant be deleted.

-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search