What is the strategy of query evaluation in DBMS when Limit is used in query?
Simplifying down to the post table, for discussion.

Create a unique index on the post_id.

CREATE UNIQUE INDEX recent_post_id ON post(post_id) 


Then query the data as such:

SELECT * 
FROM post 
WHERE user_id IN (your criteria) 
ORDER BY post_id DESC
LIMIT 30


Of course, the most overhead may well be your nested collection of rows that you UNION together to get the criteria for recent posts.