Solved

Slow running Query in SQL 2005 - how to find the cause?

Posted on 2008-06-24
7
267 Views
Last Modified: 2010-03-19
we've a slow running GRID in aspx page that is populated from a query in SQL 2005
slow running GRID = it takes 3 minutes for the GRID (10 rows / 10 columns) to populate (aspx pg to render)

how can we find the cause?
0
Comment
Question by:rastafaray
  • 3
  • 2
7 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 250 total points
ID: 21859116
you need to check for the execution plan, and need to create proper indexes
0
 

Author Comment

by:rastafaray
ID: 21861102
can you plz provide more info as to how to "check for the execution plan + create proper indexes"

thank you
0
 
LVL 143

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 250 total points
ID: 21862819
in sql management studio, open a "new query" sheet, paste the sql you run in your report, then check the "include execution plan" menu under query, then run the query.
you will get, besides the returned data tab, another one, named "excution plan".
in there you can see graphically (you might post the image here), how the query was run.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:rastafaray
ID: 21862888
actually it is a View.   does that make a difference?
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 21863026
yes and now. a view is still nothing else than a query, so running the query to get the execution plan will be just as fine as without a view.
yes, it can make a difference, especially if the view is complex and when you want to filter the views result later => some conditions will make that it can throw in the condition "inside the views" query, sometimes that's not possible.
0
 

Author Comment

by:rastafaray
ID: 22234964
is there a 3-rd part tool (free or commercial) that will show the slow queries/procedures?   i.e. a tool that will point out which part of the specific Stored Procedure code is causing the slow down
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
format nvarchar field as mm/dd/yyyy 4 80
MS SQL page split per second is high 19 106
Help with SQL - TOP 10 by date and by group 13 40
Help with simplifying SQL 6 54
Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question