List:General Discussion« Previous MessageNext Message »
From:Gleb Paharenko Date:July 20 2005 1:44pm
Subject:Re: random rows selection
View as plain text  
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 <michael@stripped> 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
 / /|_/ / // /\ \/ /_/ / /__   Gleb.Paharenko@stripped
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
       <___/   www.mysql.com



Thread
random rows selectionMichael Monashev20 Jul
  • Re: random rows selectionGleb Paharenko20 Jul
    • Re: random rows selectionMichael Monashev20 Jul
      • Re: random rows selectionGleb Paharenko21 Jul
  • Re: random rows selectionChris Knipe20 Jul
  • Re: random rows selectionNuno Pereira21 Jul