Which is more expensive? For loop or database call?

前端 未结 7 1225
我在风中等你
我在风中等你 2020-12-29 05:13

In general, which is more expensive? A double-nested for loop and one call to a database or a call to a database for each of N items in only one for loop?

Not looki

7条回答
  •  天涯浪人
    2020-12-29 05:44

    If you are going to process every item, just make one call unless it would use an outrageous amount of memory.

提交回复
热议问题