Re: Code optimization
| From: | Chris | Date: | Fri, 07 Aug 2009 00:30:45 +0000 |
| Subject: | Re: Code optimization | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-46424@lists.php.net to get a copy of this message | ||
Ron Piggott wrote:
Is there a way to optimize this with better mySQL query?Step 1 - work out which bit is slow. $start_time = time(); mysql_query (....) echo "That took " . (time() - $start_time) . " seconds<br/>\n"; I'd guess the first one is slow because of the order by random() but that's just a guess. -- Postgresql & php tutorials http://www.designmagick.com/