There are 2 SELECT statements joined by UNION.
The ORDER BY comes at the end.
The question is: Can I also put an ORDER BY after every SELECT? If I can, does that help the performance?
SELECT * FROM (SELECT * FROM TABLE1 ) ORDER BY ID DESC LIMIT 500 ) AS T1
SELECT * FROM (SELECT * FROM TABLE2 ) ORDER BY ID DESC LIMIT 500 ) AS T2
ORDER BY DATETIME DESC