Not everything can be represented by a single database query. Often there is mixing involved using multiple sources, which break down the one query for all results pattern, and thus encourage co-locating the database near the tier making the db requests.
Higher database round-trip times are fixed by using database stored procedures instead of making multitudes of tiny compound SQL queries.