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

How can I check the Long Running Query by using Stats.. Expand / Collapse
Author
Message
Posted Tuesday, April 29, 2014 3:52 AM


SSC-Enthusiastic

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

Group: General Forum Members
Last Login: Today @ 7:29 AM
Points: 152, Visits: 474
Hi All,

Here am Using SQL 2008,
How can i check the Long Running Query by using the following Query and how to tune that query to improve the Performance ..

"select * from sys.dm_exec_query_stats"

Regards..
Jagadeesh...


Regards
Chowdary...
Post #1565825
Posted Wednesday, April 30, 2014 4:32 PM
SSC-Enthusiastic

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

Group: General Forum Members
Last Login: Yesterday @ 1:49 PM
Points: 180, Visits: 7,719
Query tuning is a complex art, but Grant Fritchey's book on execution plans is a good resource to start with. It's available as a free pdf here:

http://www.red-gate.com/community/books/sql-server-execution-plans-ed-2
Post #1566623
Posted Thursday, May 1, 2014 11:33 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 7:33 AM
Points: 10,215, Visits: 13,163
You can do this to get the plan:

SELECT
DEQP.query_plan
FROM
sys.dm_exec_query_stats AS DEQS
CROSS APPLY sys.dm_exec_query_plan(DEQS.plan_handle) AS DEQP
WHERE
[some criteria to determine what is long running]

Then you can examine the execution plan to determine where/what to start stuning.




Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #1566806
Posted Thursday, May 1, 2014 11:36 PM


SSC-Enthusiastic

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

Group: General Forum Members
Last Login: Today @ 7:29 AM
Points: 152, Visits: 474
Thank u All.....
is there any Video Links for that Query Tuning...


Regards
Chowdary...
Post #1566920
Posted Thursday, May 1, 2014 11:54 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, July 21, 2014 2:56 AM
Points: 2,603, Visits: 2,061
You can find lots on google. Select as per your need.

---------------------------------------------------
"Thare are only 10 types of people in the world:
Those who understand binary, and those who don't."
Post #1566926
Posted Friday, May 2, 2014 11:16 AM
SSC-Enthusiastic

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

Group: General Forum Members
Last Login: Yesterday @ 1:49 PM
Points: 180, Visits: 7,719
I got some good tuning tips from this Brent Ozar video:
http://www.brentozar.com/archive/2014/01/watch-brent-tune-queries/
Post #1567131
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse