Posted by Roman on 05/14/07 03:10
Ciaran wrote:
> Hi All,
> Is it faster to have mySql look up as much data as possible in one
> complex query or to have php do all the complex processing and submit
> lots of simple queries to the mysql database?
>
> Cheers,
> Ciarán
>
I would vote for single complex query over multiple queries with
sub-results being processed by PHP.
Do not forget that SQL is a procedural language and you can also write
algorithms in it (I am not 100% sure about MySQL though). Any PHP to
MySQL interraction will have an interprocess overhead (on same server)
or network communication overhead (MySQL hosted on different server).
Roman
[Back to original message]
|