Re: 500 records (articles) - SELECT ALL or USE WHERE

From: Date: Wed, 05 Aug 2009 00:11:24 +0000
Subject: Re: 500 records (articles) - SELECT ALL or USE WHERE
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-46409@lists.php.net to get a copy of this message
On Aug 4, 2009, at 7:18 PM, Martin Zvarík <mzvarik@gmail.com> wrote:
I need to do about 5 queries: 1) pick the top visited articles 2) pick the recent articles (limit 10) 3) pick the most commented articles etc. Now, I have 2 choices: 1) SELECT ALL records and use PHP for conditions 2) do 5 queries on MySQL --- Imagine it has 500 long text articles. Which of these 2 options is better for performance? Thanks, Martin -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Ensure that you can return the same data for each type of query and then join then with a UNION statement and do it all in one query Bastien Sent from my iPod

« previous php.db (#46409) next »