Showing posts with label trace. Show all posts
Showing posts with label trace. Show all posts

Friday, March 23, 2012

Question on the server trace in query analyzer

Hi,

When looking in the server trace in query analyzer – I can see how many ‘reads’ a stored procedure does.
So I'm wondering if we can determine whether our query is good or bad by looking at the number of reads/writes that showing in the Trace.

Thanks in advance

The CPU, Reads, and Writes values should display a low value if your queries are performing well. If they show high values, look at the text on which these values correspond to as this displays either the step or the query. Results in the server trace are asimilar to those that you have when you run SQL Profilersql

Wednesday, March 21, 2012

Question on SQL Profiler

I am running a trace on a set of queries. What I am noticing is that the
duration for all the individual SQL statment within the batch is minimal but
yet the total duration for the same batch completed is a lot more than if I
added the duration for individul SQL statements. So my question is where is
the remaining time coming from? How do I speed that up if I do not know what
is causing the batch to take longer time?
Thanks
Try checking out how the sql queries are being executed on the client side if possible. Usually, there are other things involved like recompilations and/or sql prepare operations and/or cursor fetch(es). ODBC calls usually do this and run sp_cursoropen, s
p_prepare, sp_cursorfetch, ..., etc... Try looking at RPC's and SQL's on the profiler... =)