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 `postdenied` ADD INDEX `postdenied_idx_post_id_uid` (`post_id`,`uid`);
ALTER TABLE `posts` ADD INDEX `posts_idx_date` (`date`);
SELECT
*
FROM
posts AS p
WHERE
NOT EXISTS (
SELECT
1
FROM
postdenied AS d
WHERE
d.post_id = p.post_id
AND d.uid = p.uid
)
ORDER BY
p.date DESC LIMIT 10