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 `ORDERS` ADD INDEX `orders_idx_order_type_orderdate` (`ORDER_TYPE`,`ORDERDATE`);
ALTER TABLE `ORDERS` ADD INDEX `orders_idx_order_type_employeeid` (`ORDER_TYPE`,`EMPLOYEEID`);
SELECT
ORDERS.EMPLOYEEID,
COUNT(ORDERS.ORDER_TYPE) AS TYPECOUNT,
MIN(TIMEDIFF(ORDERS.ORDER_ACCEPTED_TIME,
ORDERS.ORDER_COMPLETION_TIME)) AS MINPREP,
MAX(TIMEDIFF(ORDERS.ORDER_ACCEPTED_TIME,
ORDERS.ORDER_COMPLETION_TIME)) AS MAXPREP
FROM
ORDERS
WHERE
ORDERS.ORDERDATE BETWEEN '4/01/2015' AND '4/30/2015'
AND ORDERS.ORDER_TYPE = 'Breakfast'
GROUP BY
ORDERS.EMPLOYEEID
ORDER BY
NULL