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

前端 未结 12 1854
鱼传尺愫
鱼传尺愫 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 14:06

    I'd say a JOIN is slower, because your query execution stops as soon as an EXISTS call finds something, while a JOIN will continue until the very end.

    EDIT: But it depends on the query. This is something that should be judged on a case-by-case basis.

提交回复
热议问题