View Single Post
Old 10-04-2009, 05:35 PM   #5 (permalink)
Village Idiot
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

Quote:
Originally Posted by Swiftaxe View Post
Village Idiot,

I timed the two different approaches. Doing 16 sql queries was way slower than looping the arrays.
Sql query time: 0.002832 msec
Array looping time: 0.000097 msec

But I guess that if there were thousands of products the sql would be faster. I only have about 30 in my test.
That is because of connection overheads associated with each individual query. Can you show us the query? I've never seen a need to use that many queries for one task before.
__________________

Village Idiot is offline  
Reply With Quote