Re: select query that uses a temporary table

2004-07-06 Thread Egor Egorov
Lorderon [EMAIL PROTECTED] wrote:

 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...

To find out top 500 of 10,000 rows ordered by some criteria you anyway need to 
sort these 10,000 rows. :) 





-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
   ___/   www.mysql.com




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



select query that uses a temporary table

2004-07-01 Thread Lorderon
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]