What is more preferable from the point of view of resource intensity, if you need a sample from the database with complex connections (join): one complex sql query or several simple queries with processing in java? What are some ways to test this in practice and compare the results?

    1 answer 1

    One difficult is better. First, the optimizer will build the execution plan taking into account the data structure, availability of indexes and table statistics, and secondly, you do not need to drive tons of unnecessary (and usually unnecessary) intermediate data over the network.