Which is more expensive? For loop or database call?

Viewed 22836

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 looking for an answer down to microseconds, just a general idea of which direction I should take.

TIA.

7 Answers
Related