RE: [PHP] Close MySQL Result

From: Date: Thu, 21 Jan 2010 22:37:35 +0000
Subject: RE: [PHP] Close MySQL Result
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-301327@lists.php.net to get a copy of this message
> -----Original Message----- > From: Nathan Rixham [mailto:nrixham@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 results Do you have any proof of this? What would be the logic here? Got some example benchmarks? Got a URL of a whitepaper or something that discusses this? I would think the only things that the mysql calls are doing is holding pointers to the next record and DB handle. I can't imagine they are using that much resources, nor would they be just spinning and waiting tying up CPU cycles either. I've never heard this to be the case.

« previous php.general (#301327) next »