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


quick sp_whoisactive question?


quick sp_whoisactive question?

Author
Message
Ncage
Ncage
Valued Member
Valued Member (53 reputation)Valued Member (53 reputation)Valued Member (53 reputation)Valued Member (53 reputation)Valued Member (53 reputation)Valued Member (53 reputation)Valued Member (53 reputation)Valued Member (53 reputation)

Group: General Forum Members
Points: 53 Visits: 51
Hello everyone, i'm using sp_whoisactive to troubleshoot a perf problem. I'll probable be posting questions about the specific problem later but i want to make sure i have all the pieces before i do.

Anyways with sp_whoisactive i'm seeing huge # of reads and relatively small # of physical reads. Is this normal? for example the # of reads is 2,541,699,042 while the # of physical_reads is 1,586. What essentially is this telling me? I never see the wait_info column (null) so the query never seems to be waiting on anything.
DBA From The Cold
DBA From The Cold
Hall of Fame
Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)

Group: General Forum Members
Points: 3375 Visits: 1757
Logical reads are reads from memory whereas physical reads are reads from disk.

If the queries are not waiting on anything then the next thing I would look at is the query execution plans. The queries are probably performing scans on large tables which would account for the high number of reads that you are seeing.

Have a look at the plans and see if appropriate indexes can be created to bring down the number of reads.

Andrew
fkeuris
fkeuris
Forum Newbie
Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: General Forum Members
Points: 5 Visits: 115
If the indexes are created and/or it is still that high amount of reads, it could also meant that the Statistics is out of date, so the optimizer is not picking the most cost effective plan
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (209K reputation)SSC Guru (209K reputation)SSC Guru (209K reputation)SSC Guru (209K reputation)SSC Guru (209K reputation)SSC Guru (209K reputation)SSC Guru (209K reputation)SSC Guru (209K reputation)

Group: General Forum Members
Points: 209591 Visits: 41973
fkeuris (7/29/2014)
If the indexes are created and/or it is still that high amount of reads, it could also meant that the Statistics is out of date, so the optimizer is not picking the most cost effective plan


It could also be "normal". The 2 Billion reads is trivial on large systems especially if there's a lot of batch processing. SQL Server can't do a thing with data unless it's in memory. Some folks' goal is to have enough memory so that the whole database can live in memory which would mean that almost everything would be logical reads and very little would be physical.

Of course, it could also be because of the things you say or it could be just crap code. It could also be from regular rebuilds or reorgs of large tables, which is a "normal" thing, as well. The overall number of reads means very little unless you can identify the source and then the cause of those reads.

I'll emphasize the crap code possibility because I've regularly run into single procs that generate tens of billions (read that as tens of Terabytes of I/O) of reads either in a single run or in multiple very short runs that occur 10,000 times in short periods of time. All of those can be fixed.

--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.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
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