Left Join outperforming Inner Join?

后端 未结 6 1955
不思量自难忘°
不思量自难忘° 2021-01-01 19:56

I\'ve been profiling some queries in an application I\'m working on, and I came across a query that was retrieving more rows than necessary, the result set being trimmed dow

6条回答
  •  囚心锁ツ
    2021-01-01 20:16

    Table cardinality has an influence on the query optimizer. I guess small tables as you have make the inner join the more complex operation. As soon as you have more records than the DB server is willing to keep in memory, the inner join will probably begin to outperform the left join.

提交回复
热议问题