SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Issue with performace query
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

kwacz23
Starting Member

44 Posts

Posted - 07/25/2013 :  04:12:05  Show Profile  Reply with Quote
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

Vietnam
6 Posts

Posted - 07/25/2013 :  04:16:40  Show Profile  Reply with Quote
You can add more index, and limit data

Maybe help you
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 07/25/2013 :  04:32:42  Show Profile  Reply with Quote
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 - 07/25/2013 :  09:21:36  Show Profile  Reply with Quote
Thanks for help> i used indexes and it helped
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 07/26/2013 :  02:18:00  Show Profile  Reply with Quote
cool

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000