It turns out that doing a join is surprisingly expensive for the DB to do when room_membership table is larger than the disk cache.