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 `es_temp1` ADD INDEX `es_temp1_idx_aord_bord` (`aord`,`bord`);
ALTER TABLE `es_temp2` ADD INDEX `es_temp2_idx_bord_aord` (`bord`,`aord`);
SELECT
x.aord,
x.anode AS parent,
x.bnode AS child
FROM
es_temp1 x
LEFT JOIN
es_temp2 y
ON x.aord = y.aord
AND x.bord > y.bord
WHERE
y.bord IS NULL
ORDER BY
x.aord,
x.bord