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:
SELECT
persontbl1._CREATION_DATE,
persontbl2._TOP_LEVEL_AURI,
persontbl2.RESP_CNIC,
persontbl2.RESP_CNIC_NAME,
persontbl1.MOB_NUMBER1,
persontbl1.MOB_NUMBER2,
schedule.id,
schedule.call_datetime,
schedule.enum_id,
schedule.enum_change,
schedule.status
FROM
persontbl1
INNER JOIN
persontbl2
ON (
persontbl2._TOP_LEVEL_AURI = persontbl1._URI
)
AND (
AGR_CONTACT = 1
)
LEFT JOIN
SCHEDULE
ON (
schedule.survey_id = persontbl1._URI
)
AND (
SCHEDULE.status = 0
)
AND (
DATE(SCHEDULE.call_datetime) <= CURDATE()
)
ORDER BY
schedule.call_datetime IS NULL DESC,
persontbl1._CREATION_DATE ASC