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

Most CPU intensive queries Expand / Collapse
Author
Message
Posted Thursday, October 28, 2010 6:31 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Sunday, January 26, 2014 11:13 AM
Points: 2,242, Visits: 3,641
Here is an attachment that lists top 9 queries consuming most CPU time. Line number 7 is most amusing to me as it shows that particular SP has been created 17163 times in the last 12 hours or so (server was rebooted 12 hours prior when this report was pulled).
Mirroring is setup on this server. I am not sure which process is creating this SP for so many times. Any thoughts?






Pradeep Singh


  Post Attachments 
perf_SSC.xls (65 views, 21.50 KB)
Post #1012252
Posted Friday, October 29, 2010 4:25 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Sunday, January 26, 2014 11:13 AM
Points: 2,242, Visits: 3,641
I checked the code behind sp_dbmmonitorupdate system stored procedure which is called every minute by the mirror monitoring job. The SP has the following code within it:

exec @retcode = sys.sp_dbmmonitorMSgetthelatestlsn @database_name, @end_of_log_lsn output

I can see sp_dbmmonitorupdate is calling this SP. however i cannot see dbmmonitorMSgetthelatestlsn SP in any of the databases including master/msdb/mirrored databases.
Top 10 CPU intensive queries says this SP is created too frequently. How do i find which process is creating this SP?

sp_dbmmonitorupdate does not have the code to create the other sp. it's just invoking it(and i cannot find that SP).
Anyone has any ideas about it?







Pradeep Singh
Post #1012899
Posted Friday, October 29, 2010 5:18 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 11:52 AM
Points: 41,530, Visits: 34,446
ps. (10/28/2010)
Line number 7 is most amusing to me as it shows that particular SP has been created 17163 times in the last 12 hours or so (server was rebooted 12 hours prior when this report was pulled).


How did you get that list?



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 #1012911
Posted Friday, October 29, 2010 6:24 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Sunday, January 26, 2014 11:13 AM
Points: 2,242, Visits: 3,641
Hi Gail, I ran this query.
select  
highest_cpu_queries.plan_handle,
highest_cpu_queries.total_worker_time,
q.dbid,
q.objectid,
q.number,
q.encrypted,
q.[text]
from
(select top 50
qs.plan_handle,
qs.total_worker_time
from
sys.dm_exec_query_stats qs
order by qs.total_worker_time desc) as highest_cpu_queries
cross apply sys.dm_exec_sql_text(plan_handle) as q
order by highest_cpu_queries.total_worker_time desc


as of now, it is occupying top slot instead of 7th position.





Pradeep Singh
Post #1012958
Posted Friday, October 29, 2010 6:34 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Sunday, January 26, 2014 11:13 AM
Points: 2,242, Visits: 3,641
the DBID is 32767 which is resource db i think. is the SP created in memory as resource db is read only? i dont know if that happens.




Pradeep Singh
Post #1012966
Posted Friday, October 29, 2010 6:37 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 11:52 AM
Points: 41,530, Visits: 34,446
It's not creating the proc, it's running it.

When you query sys.dm_exec_sql_text and the handle you pass is for a running stored proc, you get back the creation script for the proc. It does not mean that the proc is being created, it means that the proc is running.



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 #1012967
Posted Friday, October 29, 2010 6:50 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Sunday, January 26, 2014 11:13 AM
Points: 2,242, Visits: 3,641
Thanks a lot Gail. Got my answers :)





Pradeep Singh
Post #1012987
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse