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 `Employee` ADD INDEX `employee_idx_status_effectivedate` (`Status`,`EffectiveDate`);
ALTER TABLE `Employee` ADD INDEX `employee_idx_employeeid_status_effectived` (`EmployeeID`,`Status`,`EffectiveDate`);
SELECT
*
FROM
Employee AS E
WHERE
E.Status = 'Active'
AND E.EffectiveDate BETWEEN '2011-08-01' AND '2012-07-02'
AND NOT EXISTS (
SELECT
*
FROM
Employee AS E2
WHERE
E2.EmployeeID = E.EmployeeID
AND E2.Status = 'Resigned'
AND E2.EffectiveDate BETWEEN '2011-08-01' AND '2012-07-02'
)