DWQA QuestionsCategory: DatabaseWhat's the difference between SQL writing join first or where first?
silence_iris asked 1 month ago

What’s the difference between SQL writing join first or where first?

jp928 replied 1 month ago

It depends on how the database parses and optimizes query. Generally speaking, if there are m records in table a and n records in table B, the result of direct join is the Cartesian product of M and N. if the scope of M or n is reduced in advance, the performance will be greatly improved.