Hi All,

There's something that bothers me..
I have a query that uses a temporary table (has a necessary GROUP BY
clause). The query also uses ORDER BY clause (necessary too). And I also use
LIMIT clause.
If the query finds 10,000 rows, then MySQL will insert 10,000 rows into the
temporary table and sort, which makes the query very slow... :(
Any suggestions on how can I speed it up? (I would be satisfied with the top
500 rows, no need in all the 10,000)

Mabye, is there a way to tell MySQL to limit the temporary table up to 500
rows? so, when a row is matching into the top 500 rows, the last row will be
dropped out (in case the table is on limit), and the new matched row will be
inserted into the right place in the temporary table...

-thanks, Lorderon.



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to