Can I get better performance using a JOIN or using EXISTS?

前端 未结 12 1847
鱼传尺愫
鱼传尺愫 2020-12-03 13:04

I have two tables Institutions and Results and I want to see if there are any results for institutions that way I can exclude the ones that don\'t have results.

Can

12条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-03 13:56

    Are you using EXISTS as part of a correlated subquery? If so, the join will almost always be faster.

    Your database should have ways of benchmarking queries. Use them to see which query runs faster.

提交回复
热议问题