Re: Performance of ORDER BY RANDOM to select random rows? - Mailing list pgsql-general

From hubert depesz lubaczewski
Subject Re: Performance of ORDER BY RANDOM to select random rows?
Date
Msg-id 20130808085517.GA26014@depesz.com
Whole thread Raw
In response to Performance of ORDER BY RANDOM to select random rows?  (Victor Hooi <victorhooi@yahoo.com>)
List pgsql-general
On Thu, Aug 08, 2013 at 12:01:17PM +1000, Victor Hooi wrote:
> I'm just wondering if this is still the case?

Yes. Order by random() is and, most likely, will be slow. Not sure if
there is any engine that could make it fast.

> I just ran those benchmarks on my system (Postgres 9.2.4), and using ORDERY
> BY RANDOM did not seem substantially to generating random integers in
> Python and picking those out (and handling non-existent rows).

I think you accidentally a word.

depesz

--
The best thing about modern society is how easy it is to avoid contact with it.
                                                             http://depesz.com/


pgsql-general by date:

Previous
From: Alban Hertroys
Date:
Subject: Re: How to prevent clear screen when query finish ?
Next
From: AI Rumman
Date:
Subject: setting high value for wal_keep_segments