Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 help with finding under performing views?

Author  Topic 

rockcrawl
Starting Member

4 Posts

Posted - 2010-02-27 : 15:52:50
I am trying to improve performance and am wanting to find a View that can be tuned with an index or something of that nature. I am running SQL 2008 and have been running a trace and kinda am stuck as what to do next.

Any help would be greatly appreciated!!!

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2010-02-27 : 21:45:37
you can start off with querying the DMVs to find your problem queries - queries taking long time, queries with heavy IO, queries with high CPU consumption, queries recompiling often etc. Start here - http://technet.microsoft.com/en-us/sqlserver/bb671430.aspx

Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-02-28 : 01:05:00
Lets just back up a bit:

What version of SQL?

Is there a particular view you want to tune? or do you think there is a slow view but you don't know which one? or you just want to learn how to tune a view (i.e. to gain experience etc.)?

What trace have you been running? Slow queries - or something else?
Go to Top of Page

rockcrawl
Starting Member

4 Posts

Posted - 2010-02-28 : 16:08:01
I am using sql server 2008.

I do not have a particular one that I want tune.

Trying to learn how to find poor performing ones and then tune them.

-Ben
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-02-28 : 16:17:54
A very good place to start is with the built-in performance reports.

In SSMS, right-click the server instance (in the object explorer) then choose REPORTS / Standard Reports

Performance - Top queries by Total IO
Performance - Top queries by Average IO
Performance - Top queries by Total CPU Time
Performance - Top queries by Average CPU Time

Look to tune the top queries it lists in the reports.
Go to Top of Page

rockcrawl
Starting Member

4 Posts

Posted - 2010-02-28 : 23:29:22
Ok this got me some results.

After running these what would the next step be?

Should I post the results? I am kinda stuck.

Thanks!

BC
Go to Top of Page

rockcrawl
Starting Member

4 Posts

Posted - 2010-03-01 : 10:16:21
I have used the both the activity monitor and the standard reports.
How do I choose which qry to look at?
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-03-01 : 11:31:34
the ones in your reports are the most expensive queries. attack the ones in the report that are executed the most times.

i'll measure query cost as:
(# of read) * (# of executions)
or
(cpu time) * (# of executions)

Generally speaking, query optimization is the practice of reducing the # of reads.
Go to Top of Page
   

- Advertisement -