Is too many Left Joins a code smell?

前端 未结 8 1799
南笙
南笙 2021-01-01 09:30

If you have for example > 5 left joins in a query is that a code smell that there is ...

  • something wrong with your design?
  • you\'re doing too much in o
8条回答
  •  梦谈多话
    2021-01-01 09:38

    In the sense that it's something you could/should investigate I'd say yes. It's likely you can get better utility and maintenance by factoring some views out of that.

    In the sense that it's "bad code" no, this could quite easily be reasonable especially for larger DBs and modern databases will likely optimise any inefficiencies out.

提交回复
热议问题