I have a database which is getting a lot of calls to the following procedure:
exec dbo.SM_SP_MAILEVENTNAMES 167260
In Profiler using the TSQL_Duration trace these calls show up as:
EventClass: RPC: Completed
Duration: 900 to 1500 ms
Reads: 8818
Running the same query in Management Studio with Statistics I/O:
set statistics io on
exec dbo.SM_SP_MAILEVENTNAMES 167260
Runs instantaneously and has the following I/O output:
Table 'SM_MAIL_CONTACTS'. Scan count 0, logical reads 29, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table 'SM_MAIL_EVENT_CONTACTS'. Scan count 13, logical reads 68, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table 'SM_MATTER_EVENTS'. Scan count 1, logical reads 3, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
The query itself returns about 3 rows. Why the disparity in what I am seeing in Profiler and Management Studio?
exec dbo.SM_SP...
). Who/what is running the instance of the procedure that is getting captured by trace?