Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which is fastest? Data retrieval

Is it quicker to make one trip to the database and bring back 3000+ plus rows, then manipulate them in .net & LINQ or quicker to make 6 calls bringing back a couple of 100 rows at a time?

like image 430
SteveCl Avatar asked Dec 31 '22 09:12

SteveCl


1 Answers

It will entirely depend on the speed of the database, the network bandwidth and latency, the speed of the .NET machine, the actual queries etc.

In other words, we can't give you a truthful general answer. I know which sounds easier to code :)

Unfortunately this is the kind of thing which you can't easily test usefully without having an exact replica of the production environment - most test environments are somewhat different to the production environment, which could seriously change the results.

like image 164
Jon Skeet Avatar answered Jan 05 '23 17:01

Jon Skeet