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
 SQL Server 2008 Forums
 Transact-SQL (2008)
 How to reduce the Execution time of the Qurey

Author  Topic 

kond.mohan
Posting Yak Master

213 Posts

Posted - 2012-11-03 : 02:00:20
Dear all,

we are created Sql Query in Sql server 2008. query is simple select statement.we have joined with 4 tables .
select statement total(10 columns) one of the column is MAX(Abc.start_Date) my where clause one of the Condition is Abc.Start_Date<def.end_date.and mentioned by group by remaining columns i am getting the output below 15000 Records.and query execution time is more than 40 MINTUES.
and how to Reduce the query execution time of the query






sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-11-03 : 08:33:46
A few things to look at:

a) What kind of indexes do you have on the tables? Typically indexes on the columns involved in where clause and join conditions would help.

b) Look at the execution plan (press control-m in SSMS before you run the query). Look at which parts of the query take more of the resources and concentrate on those.

c) Make sure that the database is maintained properly - statistics are updated regularly, and indexes are rebuilt or reorganized if fragmented.

If you post the query some of the people on the forum may be able to offer more specific suggestions.
Go to Top of Page
   

- Advertisement -