On Sun, Mar 29, 2009 at 10:24 AM, marcin mank <marcin(dot)mank(at)gmail(dot)com> wrote:
> I think (a part of) Your problem is that order by random() is O(N
> logN) complexity, while You are after O(N) .
>
> The solution (in pseudocode)
>
[snip]
OK, I may be guiding You the wrong way
select g,g,g,g from generate_series(1,25000000) as g order by random() limit 10
executes in under thirty seconds, so I don`t think the sort is a problem.
Greetings
Marcin