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)
 Issue with performace query

Author  Topic 

kwacz23
Starting Member

44 Posts

Posted - 2013-07-25 : 04:12:05
Hi

Could you help me to speed up below query. In the view there is 262 000 records. The query is running about 30 min and still not finish

select SUM(amount),PartNumber from v_rptInvoiceData_EW
where InvoiceChargeMonthInt=2
group by PartNumber

Regards

demons
Starting Member

6 Posts

Posted - 2013-07-25 : 04:16:40
You can add more index, and limit data

Maybe help you
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-07-25 : 04:32:42
Is that a view?
Can you show your queries execution plan?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

kwacz23
Starting Member

44 Posts

Posted - 2013-07-25 : 09:21:36
Thanks for help> i used indexes and it helped
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-07-26 : 02:18:00
cool

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -