April 22, 2010 at 3:52 am
Hi All,
Last week we designed a query to generate a report. Initially this query was running fine fetching all records in 10 sec, but this week it is running quite slow on the system and taking more than 2 min to fetch same count of records. We run this query on our test servers on same data, there it is fetching the results in 11 seconds.
Please advice me that, where do I look to improve the performance for this query. What software and hardware factors are responsible for this situation.
Nikesh
April 22, 2010 at 6:42 am
trivedi.nikesh (4/22/2010)
Hi All,Last week we designed a query to generate a report. Initially this query was running fine fetching all records in 10 sec, but this week it is running quite slow on the system and taking more than 2 min to fetch same count of records. We run this query on our test servers on same data, there it is fetching the results in 11 seconds.
Please advice me that, where do I look to improve the performance for this query. What software and hardware factors are responsible for this situation.
Nikesh
It could be any number of things. The first thing that leaps to mind is parameter sniffing. Check the execution plans when the query runs fast and when it runs slow. Also, you could have statistics that are out of date due to data changes. Indexes could be fragemented. You might be seeing contention for resources on the server... The list goes on.
In addition to looking at the execution plans, I'd suggest gathering wait and queue statistics on the server. Here's an excellent article from Microsoft on how to do this.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 23, 2010 at 12:37 am
Dear Sir,
I am heartily thankful to you. I will apply your suggested measures.
Please correct me if I am wrong
Reason behind Query is not performing good due to (in case it is tuned):
1. Fragmentation of Pages
2. Statistics are not updated
3. No sufficient Memory
4. More I/O
5. Blockings
6. Huge CPU utilization
Please update this list if some thing is missing here.
Thanks again.
April 23, 2010 at 6:19 am
trivedi.nikesh (4/23/2010)
Dear Sir,I am heartily thankful to you. I will apply your suggested measures.
Please correct me if I am wrong
Reason behind Query is not performing good due to (in case it is tuned):
1. Fragmentation of Pages
2. Statistics are not updated
3. No sufficient Memory
4. More I/O
5. Blockings
6. Huge CPU utilization
Please update this list if some thing is missing here.
Thanks again.
That's the basic list, but based on that list, I wouldn't assume the query was tuned. I would assume there were tuning opportunities available.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 23, 2010 at 7:21 pm
trivedi.nikesh (4/23/2010)
Dear Sir,I am heartily thankful to you. I will apply your suggested measures.
Please correct me if I am wrong
Reason behind Query is not performing good due to (in case it is tuned):
1. Fragmentation of Pages
2. Statistics are not updated
3. No sufficient Memory
4. More I/O
5. Blockings
6. Huge CPU utilization
Please update this list if some thing is missing here.
Thanks again.
You missed two...
7. Data in tables increased
8. Different hardware either for the server or the pipe.
--Jeff Moden
Change is inevitable... Change for the better is not.
April 26, 2010 at 1:34 am
Thank you for update in this list, I will work on this also.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply