Includere t.user_id darebbe solo post in cui l’utente era anche l’OP. Potrebbe essere questo il problema principale?
Ho notato un paio di aggiunte che potrebbero essere utili. Qualcosa come:
-- [params]
-- user_id :user
SELECT t.id AS topic_id,
t.title,
p.raw as text,
p.created_at as dateposted
FROM posts p
JOIN topics t ON t.id = p.topic_id
WHERE t.archetype != 'private_message'
AND p.post_type IN (1, 4)
AND p.user_id = :user
AND t.deleted_at ISNULL
AND p.deleted_at ISNULL
ORDER BY p.created_at