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:
CREATE INDEX favourites_idx_articlesuserid_articleid ON "favourites" ("articlesUserID","articleID");
CREATE INDEX posts_idx_userid_postdate ON "posts" ("userID","postdate" desc);
SELECT
posts.id,
posts.title,
posts.author,
posts.postdate,
posts.postcontent,
posts.userID
FROM
posts
WHERE
posts.userID = 12
AND EXISTS (
SELECT
1
FROM
favourites
WHERE
(
favourites.articlesUserID = 12
)
AND (
posts.id = favourites.articleID
)
)
ORDER BY
posts.postdate DESC