I have a question regarding the performance of SQL. I will illustrate my problem with pseudocode.
I am wondering which will preform better and by how much? Say for 10 items, on each page load. In .NET. Is is a lot faster? a little faster? A difference not noticable on SQL?
foreach(item in mylist) {
CallSQLStoredProc(item.id);
}
vs
int[] ids; // array of ids
CallSQLStoredProc(ids) // stored procedure returns more than one row for each id
The second option will certainly be faster because it is a single network round trip, as well as a single SP call.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With