MySQL Forums
Forum List  »  Performance

Re: Query optimization and index suggestion needed
Posted by: Pandit P
Date: September 09, 2020 11:38PM

Thanks Mr. Peter Brawley,

SELECT cust_id, Left(report_date,7) as YrMo, SUM(gross_amount)
FROM sales_report FORCE INDEX index sr_mv_custid_clntnum_customer_rptdte_grssamnt
WHERE report_date between '2019-01-01' and '2020-09-07'
GROUP BY cust_id, YrMo;

This query is taking 31 seconds.

I will think about precomputing the Working_Days instead of using the function also check innodb_buffer_pool_size.

Regards
Praveen

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Query optimization and index suggestion needed
153
September 09, 2020 11:38PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.