Should I use one big SQL Select statement or several small ones?

后端 未结 7 692
一整个雨季
一整个雨季 2021-01-17 08:54

I\'m building a PHP page with data sent from MySQL.

Is it better to have

  • 1 SELECT query with 4 table joins, or
  • 4 small SELE
7条回答
  •  醉话见心
    2021-01-17 09:27

    I would say 1 query with the join. This way you need to hit the server only once. And if your tables are joined with indexes, it should be fast.

提交回复
热议问题