Reply to Re: php vs mysql speed

Your name:

Reply:


Posted by Boris Stumm on 05/10/07 16:47

Ciaran wrote:
> Hmm, What about at the most basic level. For example would it be
> quicker to run:
> SELECT * FROM users WHERE userID IN
> (1,2,4,7,8,9,10,11,13,14,15,17,18,35,etc,etc,etc);
>
> or select each userID seperately in a PHP foreach loop with something
> like this statement:
> SELECT * FROM users WHERE userID=2 LIMIT 1;

In terms of complexity, both queries are equally complex, although the
first one looks a bit like there is some design issue. Anyways, doing it
the first way will be lot faster than doing it the second way (in my
opinion)

> I'm basically asking: Is it contacting the database that slows down
> PHP or is it the actual speed at which mySQL runs.

Depends :)

> The former suggests that one big query would generally be quicker
> while the latter suggests many basic queries would generally be
> quicker.
> I'm just looking for a rule of thumb here, not hard answers.

See my other post.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация