Slow SQL query causes homepage to load in 2-4 sec

There should be a second version of this query showing up in the logs, mostly identical but without highest_staff_post_number.

Also note that there is a UNION ALL here; split the query into 2 on that.

So that’s a 2x2 matrix; try running EXPLAIN ANALYZE on all 4; is there a significant difference for staff vs nonstaff?