Re: intermittant performance problem - Mailing list pgsql-general

From marcin mank
Subject Re: intermittant performance problem
Date
Msg-id b1b9fac60903290151r5526788cw9740a55f89d639e9@mail.gmail.com
Whole thread Raw
In response to Re: intermittant performance problem  (marcin mank <marcin.mank@gmail.com>)
List pgsql-general
On Sun, Mar 29, 2009 at 10:24 AM, marcin mank <marcin.mank@gmail.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

pgsql-general by date:

Previous
From: marcin mank
Date:
Subject: Re: intermittant performance problem
Next
From: ray
Date:
Subject: Re: Authentication Failed - new user installation