performance - single join select vs. multiple simple selects

后端 未结 8 1564
逝去的感伤
逝去的感伤 2020-12-15 04:08

What is better as far as performance goes?

8条回答
  •  一向
    一向 (楼主)
    2020-12-15 05:01

    Do not try to write your own join loop as a bunch of selects. Your database server has many clever algorithms for doing joins. Further, your database server can use statistics and estimated cost of access to dynamically pick a join algorithm.

    The database server's join algorithm is -- usually -- better than anything you might concoct. They know more about physical I/O, caching and what-not.

    This allows you to focus on your problem domain.

提交回复
热议问题