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

... or possibly the subquery for root_subject is triggering a sequential scan ...