an overall thought: this is designed to be called for blocks of user ids, though we have no reason to think that any two users will have subscriptions in common.  therefore, while we can somewhat throttle the workload by controlling the size of the user block, the worst case scenario for this access path seems pretty bleak.

given that we know the consumer of this function will only be interested in the most recent N posts in the most recent M threads per user, would it make sense to make to iterate by user so we can leverage indexes to fetch a limited number of the most recent content, making the perf a little more linear?