e2f1e10225
The idea here is to replace the existing LEFT JOINs and OR / IS NOT NULL conditions with INNER JOINs and ANDs. So we gather the discussions data from all three areas in individual queries, make their UNION. The GROUP BY was present before and maybe it is not even needed any more (due to how UNION works) but it should not hurt to keep it. This leads to significantly improved performance.