Dennis Cote wrote:
> Barbara Weinberg wrote:
>> I was wondering whether anyone had tried sorting records in random order
>> using sqlite3. I tried sorting by random() and randomblob() but it was very
>> slow and chewed up lots of resources. Any suggestions?
> 
> Can you provide any more details about what you are trying to accomplish?
> 
> There have been several previous discussions about selecting random 
> records from a table. You may want to look for those in the archives. If 
> you really need  to sort the entire table then you are probably stuck 
> with the slow operation. If you only need a random subset of a table 
> then you may be able to use some of these ideas to speed things up.
> 
> HTH
> Dennis Cote
> 

If you have sequential rowids and know the largest then you can use a PRNG
and get a random rowid to lookup.  That will be optimally fast.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to