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

SQL Profiler v/s Query window Expand / Collapse
Author
Message
Posted Tuesday, November 16, 2010 7:19 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, February 21, 2013 3:14 AM
Points: 134, Visits: 425
Hi Guys,

I noticed in the pro filer that an Stored procedure taking less reads but duration is uncountable ,
If i execute the same SP in Query window it returning results in a second

What might be the problem ,Please guide me
Post #1021496
Posted Tuesday, November 16, 2010 7:48 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 7:47 AM
Points: 12,901, Visits: 32,139
help us help you...when i read your question, i think the question is "when i profile my procedure, it never finishes. when i just run it, it is fast"
is that correct?

or is this a question about SOMETIMES your procedure is slow, and sometimes it is fast(parameter sniffing?)



Lowell

--There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #1021524
Posted Tuesday, November 16, 2010 8:36 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, February 21, 2013 3:14 AM
Points: 134, Visits: 425
Let me explain what actually happened
We found that application was slow ,So we switched on profiler to find the slow running query.
As we measure the performance of query/SP in terms of reads,CPU,Duration etc.we saw the SP which is taking less reads but uncountable duration (Milli seconds).We thought that this SP might slowing down the application and took the profiler data of that SP and executed in query window but it hardly took an second.If this Sp is not of performance issue then why the duration in profiler was very very high?
I hope you i reached you.
Post #1021895
Posted Wednesday, November 17, 2010 1:06 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, September 15, 2014 2:38 AM
Points: 2,223, Visits: 3,647
Did you run the SP or did you run the T-SQL code which is part of SP?
If it is latter, I'll agree with Lowell's second point. It's highly likely due to parameter sniffing.





Pradeep Singh
Post #1021951
Posted Wednesday, November 17, 2010 2:34 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, February 21, 2013 3:14 AM
Points: 134, Visits: 425
I ran whole SP,Then what might be the reason for uncountable duration for that SP?
Is there any way to reduce the duration?
Post #1021979
Posted Wednesday, November 17, 2010 2:46 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, September 15, 2014 2:38 AM
Points: 2,223, Visits: 3,647
Does your SP accepts parameters? If yes, pls modify the parameters to different sets of values and observe the time taken by it. is it same?

Profiler does nothing but gives you details of the SP which was invoked by a process or a user.





Pradeep Singh
Post #1021993
Posted Wednesday, November 17, 2010 4:48 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, February 21, 2013 3:14 AM
Points: 134, Visits: 425
I checked with as you suggested and it returning the same . what the duration accounts for?
Post #1022066
Posted Wednesday, November 17, 2010 5:13 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, September 15, 2014 2:38 AM
Points: 2,223, Visits: 3,647
Duration is the total time spent by that SP/Query. Its measured in milliseconds.





Pradeep Singh
Post #1022077
Posted Wednesday, November 17, 2010 5:16 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, February 21, 2013 3:14 AM
Points: 134, Visits: 425
Is there any way to reduce it as it going beyond the count..
Post #1022079
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse