Re: intermittant performance problem

From: marcin mank <marcin(dot)mank(at)gmail(dot)com>
To: Mike Charnoky <noky(at)nextbus(dot)com>
Cc: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: intermittant performance problem
Date: 2009-03-29 08:51:35
Message-ID: b1b9fac60903290151r5526788cw9740a55f89d639e9@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Vibhor Kumar 2009-03-29 09:34:42 Re: problem with locale :
Previous Message marcin mank 2009-03-29 08:24:48 Re: intermittant performance problem