Re: [PHP] Close MySQL Result

2010-01-22 Thread Michael Schaefer
Interesting, I don't have any numerical benchmarks, but I saw a performance benefit moving my result set into an array. My case may have been extreme, I was creating a table 350 rows by 350 columns, several megabytes of output, and I found that building the output directly from the query too

Re: [PHP] Close MySQL Result

2010-01-22 Thread Nathan Rixham
Always found the same myself on large datasets and when working with high traffic sites; but cant replicate in a non-live environment or with simple grinder style tests; so just follow the procedure as standard practise in all my code now - likewise with dropping keep alive times on apache servers

Re: [PHP] Close MySQL Result

2010-01-21 Thread Nathan Rixham
Ashley Sheridan wrote: On Wed, 2010-01-20 at 13:24 -0800, Daevid Vincent wrote: http://www.php.net/manual/en/function.mysql-free-result.php mysql_free_result($myresult); NOTE: mysql_free_result() only needs to be called if you are concerned about how much memory is being used for queries

RE: [PHP] Close MySQL Result

2010-01-21 Thread Daevid Vincent
-Original Message- From: Nathan Rixham [mailto:nrix...@gmail.com] you'll also find a performance upgrade if you load all sql results in to an array and close up the query / free the results before working on them. query for() { $results[] = $row; } close stuff work on

Re: [PHP] Close MySQL Result

2010-01-21 Thread Shawn McKenzie
Daevid Vincent wrote: -Original Message- From: Nathan Rixham [mailto:nrix...@gmail.com] you'll also find a performance upgrade if you load all sql results in to an array and close up the query / free the results before working on them. query for() { $results[] = $row; }

Re: [PHP] Close MySQL Result

2010-01-21 Thread Nathan Rixham
Shawn McKenzie wrote: Daevid Vincent wrote: -Original Message- From: Nathan Rixham [mailto:nrix...@gmail.com] you'll also find a performance upgrade if you load all sql results in to an array and close up the query / free the results before working on them. query for() {

RE: [PHP] Close MySQL Result

2010-01-20 Thread Daevid Vincent
http://www.php.net/manual/en/function.mysql-free-result.php mysql_free_result($myresult); NOTE: mysql_free_result() only needs to be called if you are concerned about how much memory is being used for queries that return large result sets. All associated result memory is automatically freed at

Re: [PHP] Close MySQL Result

2010-01-20 Thread Slack-Moehrle
Daevid, Thanks for the links so I can read up! -ML - Original Message - From: Daevid Vincent dae...@daevid.com To: php-general@lists.php.net Cc: Slack-Moehrle mailingli...@mailnewsrss.com Sent: Wednesday, January 20, 2010 1:24:16 PM Subject: RE: [PHP] Close MySQL Result http

RE: [PHP] Close MySQL Result

2010-01-20 Thread Ashley Sheridan
On Wed, 2010-01-20 at 13:24 -0800, Daevid Vincent wrote: http://www.php.net/manual/en/function.mysql-free-result.php mysql_free_result($myresult); NOTE: mysql_free_result() only needs to be called if you are concerned about how much memory is being used for queries that return large