Hello.




Similar questions have been asked before. For example:

  http://lists.mysql.com/mysql/184088

        

Search in archives at:

  http://lists.mysql.com/mysql







Michael Monashev <[EMAIL PROTECTED]> wrote:

> Hello,

> 

> How to select 5 random rows from big table with WHERE clause?

> 

> This query very slow on 1 mln rows:

> SELECT col1, col2 FROM table WHERE col3=123 ORDER BY RAND() LIMIT 5

> 

> Have you a faster one?

> 

> Sincerely,

> Michael,

> http://xoib.com/ http://3d2f.com/

> http://qaix.com/ http://ryxi.com/

> http://gyxe.com/ http://gyxu.com/

> http://xywe.com/ http://xyqe.com/

> 

> 

> 



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   [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]

Reply via email to