Re: Efficiency question
| From: | Hugh Bothwell | Date: | Fri, 27 Jun 2003 03:17:14 +0000 |
| Subject: | Re: Efficiency question | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-28935@lists.php.net to get a copy of this message | ||
"Micah Stevens" <micah@raincross-tech.com> wrote in message
news:200306261904.27707.micah@raincross-tech.com...
> $data = mysql_fetch_assoc(mysql_query("select * from some_table limit
1"));
>
> would be faster than:
>
> $pointer = mysql_query("select * from some_table limit 1");
> $data = mysql_fetch_assoc($pointer);
>
> but I'm not sure, php may optimize this. Anyone know the answer?
It will be faster by one store and one fetch... the
database query probably takes 1000 times as long.
I don't think the difference is worth the time you'd
take to change it.
--
Hugh Bothwell hugh_bothwell@hotmail.com Kingston ON Canada
v3.1 GCS/E/AT d- s+: a- C+++ L++>+++$ P+ E- W+++$ N++ K? w++ M PS+
PE++ Y+ PGP+ t-- 5++ !X R+ tv b++++ DI+++ D-(++) G+ e(++) h-- r- y+