MySQL: Top $num results
| From: | ioannes | Date: | Sun, 13 Feb 2005 17:31:34 +0000 |
| Subject: | MySQL: Top $num results | ||
| References: | 1 2 3 4 5 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-38570@lists.php.net to get a copy of this message | ||
"If you use LIMIT row_count with ORDER BY, MySQL ends the sorting as soon as it has found the first row_count lines rather than sorting the whole table. "
http://dev.mysql.com/doc/mysql/en/limit-optimization.html
I need to get the top $num results from a completely sorted table (eg sorted on ID, ie the $num latest inserted rows). Which functions should I be considering?
John