"which of the following sql queries would be faster? a join on two tables or successive queries?" Code Answer

5

every query has overhead. if you can do something with one query, it's (almost) always better to do it with one query. and most database engines are smarter than you. even if it's better to split a query in some way, the database will find out himself.

an example of overhead: if you perform 100 queries, there will be a lot more traffic between your application and your webserver.

in general, if you really want to know something about performance, benchmark the various approaches, measure the parameters you're interested in and make a decision based on the results of the becnhmark.

good luck!

By Kuntady Nithesh on April 18 2022

Answers related to “which of the following sql queries would be faster? a join on two tables or successive queries?”

Only authorized users can answer the Search term. Please sign in first, or register a free account.