In case you have your own slow SQL query, you can optimize it automatically here.
For the query above, the following recommendations will be helpful as part of the SQL tuning process.
You'll find 3 sections below:
ALTER TABLE `SalesRecords` ADD INDEX `salesrecords_idx_date` (`Date`);
SELECT
SalesRecords.Date,
COUNT(*) AS Sales,
SUM(CASE
WHEN SalesRecords.ComplaintMade = 'True' THEN 1
ELSE 0 END) AS Complaints
FROM
SalesRecords
WHERE
SalesRecords.Date BETWEEN '2014-07-01' AND '2014-07-05'
GROUP BY
SalesRecords.Date
ORDER BY
SalesRecords.Date