Welcome Guest, Not a member yet? Register   Sign In
Random Database Pull
#9

[eluser]Pygon[/eluser]
Yes -- posted the edit -- I didn't notice the where(set,1) in xwero's query.

The performance on my query, while random, is incredibly bad.

I would suggest implementing something like this: http://jan.kneschke.de/projects/mysql/order-by-rand/

If you're worried about sub-query support, select_max and do your randomizing/ceil in php, then do a second select with your where and order_by. Really the holes is only a concern if you are worried about even random distribution across sets with gaps in the number (1,2,5,12)


Messages In This Thread
Random Database Pull - by El Forum - 03-11-2008, 08:01 AM
Random Database Pull - by El Forum - 03-11-2008, 08:15 AM
Random Database Pull - by El Forum - 03-11-2008, 08:19 AM
Random Database Pull - by El Forum - 03-11-2008, 08:28 AM
Random Database Pull - by El Forum - 03-11-2008, 08:49 AM
Random Database Pull - by El Forum - 03-11-2008, 08:50 AM
Random Database Pull - by El Forum - 03-11-2008, 08:52 AM
Random Database Pull - by El Forum - 03-11-2008, 08:56 AM
Random Database Pull - by El Forum - 03-11-2008, 09:06 AM
Random Database Pull - by El Forum - 03-11-2008, 09:09 AM
Random Database Pull - by El Forum - 03-11-2008, 09:31 AM
Random Database Pull - by El Forum - 03-11-2008, 09:42 AM
Random Database Pull - by El Forum - 03-11-2008, 12:21 PM
Random Database Pull - by El Forum - 03-11-2008, 12:32 PM
Random Database Pull - by El Forum - 03-11-2008, 01:16 PM
Random Database Pull - by El Forum - 03-11-2008, 01:45 PM
Random Database Pull - by El Forum - 03-11-2008, 02:27 PM



Theme © iAndrew 2016 - Forum software by © MyBB