Better way to query posts?

Since the queries are not related to each other, there is no other way around it. You are going to end with with many queries and slow page (when it is not cached) on a site with many categories.

A better approch may be to show latest 50 posts, and display them by category, but it depends on what is it that you actually want to be displayed. If it is a news style page, then you will just have to apply some caching in order to get good performance.

error code: 523