Forum .LRN Q&A: Response to Message View in Forums is very slow on Postgresql

I ran the subselect seperately and it takes a few seconds to run. So I suspect this is the culprit. Also the query plan shows a sequential scan on forums_messages with the query.