This query runs slow:

SELECT id FROM data ORDER BY random();

but this equivalent query runs very fast:

SELECT id FROM (SELECT id, random() r FROM data) ORDER BY r;

HTH,

Sam


On Wed, May 7, 2008 at 2:37 PM, Barbara Weinberg <[EMAIL PROTECTED]> wrote:

> Hi
> 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?
> Barbara
> _______________________________________________
>


-- 
-----------------------------------------------------------------
We're Hiring! Seeking passionate Flex, C#, or C++ (RTSP, H264) developer.
Position is in the Washington D.C. metro area. Contact
[EMAIL PROTECTED]
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to