Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2008
»
SQL Server 2008 Administration
»
What is a read ?
14 posts, Page 1 of 2
1
2
»»
What is a read ?
Rate Topic
Display Mode
Topic Options
Author
Message
SQLSACT
SQLSACT
Posted Saturday, October 06, 2012 3:19 PM
Ten Centuries
Group: General Forum Members
Last Login: Yesterday @ 8:22 AM
Points: 1,258,
Visits: 2,232
Hi All
When using DMV's to assess your SQL instance, what is a read?
For example, when dealing with DMV's like:
sys.dm_exec_query_stats
sys.dm_exec_requests
There are columns like
logical_reads
,
physical_reads
etc...
My questions is, is a read when SQL reads one page?
Thanks
Post #1369469
Perry Whittle
Perry Whittle
Posted Saturday, October 06, 2012 3:39 PM
SSCertifiable
Group: General Forum Members
Last Login: Today @ 4:02 AM
Points: 5,244,
Visits: 11,264
a logical read is the pages that are read in memory, a physical read is when the page is brought in from disk
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs"
Post #1369470
SQLSACT
SQLSACT
Posted Saturday, October 06, 2012 8:09 PM
Ten Centuries
Group: General Forum Members
Last Login: Yesterday @ 8:22 AM
Points: 1,258,
Visits: 2,232
Perry Whittle (10/6/2012)
a logical read is the pages that are read in memory, a physical read is when the page is brought in from disk
Thanks
Does 1 read mean 1 page?
Post #1369491
Perry Whittle
Perry Whittle
Posted Sunday, October 07, 2012 12:56 AM
SSCertifiable
Group: General Forum Members
Last Login: Today @ 4:02 AM
Points: 5,244,
Visits: 11,264
Yes a read is a page. A logical read may need to initiate a physical read first if the requested page is not in cache.
more info may be found at
this link
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs"
Post #1369501
CYates
CYates
Posted Monday, October 08, 2012 12:57 PM
Forum Newbie
Group: General Forum Members
Last Login: Yesterday @ 8:17 AM
Points: 7,
Visits: 100
I've always gone by Microsoft's explanation:
“The I/O from an instance of SQL Server is divided into logical and physical I/O. A logical read occurs every time the database engine requests a page from the buffer cache. If the page is not currently in the buffer cache, a physical read is then performed to read the page into the buffer cache. If the page is currently in the cache, no physical read is generated; the buffer cache simply uses the page already in memory.”
Also, keep in mind that when you run a trace it is considered a logical read and not physical.
Physical reads for me have been a pain point when dealing with performance.
Post #1370004
Jeff Moden
Jeff Moden
Posted Monday, October 08, 2012 3:02 PM
SSC-Dedicated
Group: General Forum Members
Last Login: Yesterday @ 11:54 PM
Points: 33,113,
Visits: 27,041
CYates (10/8/2012)
I've always gone by Microsoft's explanation:
...
{snip}
Also, keep in mind that when you run a trace it is considered a logical read and not physical.
Have you got an MS link that explains that as well?
--Jeff Moden
"
RBAR
is pronounced "ree-bar" and is a "Modenism" for "
R
ow-
B
y-
A
gonizing-
R
ow".
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."
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Post #1370067
Jeff Moden
Jeff Moden
Posted Monday, October 08, 2012 3:05 PM
SSC-Dedicated
Group: General Forum Members
Last Login: Yesterday @ 11:54 PM
Points: 33,113,
Visits: 27,041
Never mind. I got it. BOL states:
Reads
The number of read operations on the logical disk that are performed by the server on behalf of the event. These read operations include all reads from tables and buffers during the statement's execution.
In this case, I don't believe that "logical" means just "logical reads". It would appear to include both physical and logic reads for the "logically named disk".
Of course, I could have misinterpreted that. Any one else have something more finite?
--Jeff Moden
"
RBAR
is pronounced "ree-bar" and is a "Modenism" for "
R
ow-
B
y-
A
gonizing-
R
ow".
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."
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Post #1370071
Jeff Moden
Jeff Moden
Posted Monday, October 08, 2012 3:17 PM
SSC-Dedicated
Group: General Forum Members
Last Login: Yesterday @ 11:54 PM
Points: 33,113,
Visits: 27,041
Ah... got it. If found (and immediately forgot to copy the URL for) a post by Microsoft Certified Master Gail Shaw where she explained that SQL Server actually only reads from the "buffer pool" which is all "logical". Reads from the physical disk are always read into the "Buffer Pool". It's the reads from that "Buffer Pool" that SQL Profiler counts.
It would appear that the only way to easily find out if physical reads were actually involved is to SET STATISTICS IO ON before you run the query.
--Jeff Moden
"
RBAR
is pronounced "ree-bar" and is a "Modenism" for "
R
ow-
B
y-
A
gonizing-
R
ow".
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."
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Post #1370080
Perry Whittle
Perry Whittle
Posted Monday, October 08, 2012 3:28 PM
SSCertifiable
Group: General Forum Members
Last Login: Today @ 4:02 AM
Points: 5,244,
Visits: 11,264
Jeff Moden (10/8/2012)
CYates (10/8/2012)
I've always gone by Microsoft's explanation:
...
{snip}
Also, keep in mind that when you run a trace it is considered a logical read and not physical.
Have you got an MS link that explains that as well?
Yes, the link i posted above
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs"
Post #1370086
GilaMonster
GilaMonster
Posted Monday, October 08, 2012 4:03 PM
SSC-Dedicated
Group: General Forum Members
Last Login: Today @ 6:11 AM
Points: 38,119,
Visits: 30,404
Jeff Moden (10/8/2012)
Reads from the physical disk are always read into the "Buffer Pool". It's the reads from that "Buffer Pool" that SQL Profiler counts.
Easiest way to think about it is that all reads are logical. Some of the logical reads may additionally be physical reads (the page required wasn't in the buffer pool)
Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild
: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter
We stand on the bridge and no one may pass
Post #1370093
« Prev Topic
|
Next Topic »
14 posts, Page 1 of 2
1
2
»»
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.