Re: selecting random rows

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: selecting random rows
Дата
Msg-id 4526.1063330459@sss.pgh.pa.us
обсуждение исходный текст
Ответ на selecting random rows  (Joseph Shraibman <jks@selectacast.net>)
Список pgsql-general
Joseph Shraibman <jks@selectacast.net> writes:
> Is there a way to get random rows besides ORDER BY random()?

Are you willing to expend an extra column in the table, plus an index on
the column, to make this fast?  Then you can do it --- see discussion
just a few days ago.
http://archives.postgresql.org/pgsql-performance/2003-08/msg00526.php

If you are willing to settle for "only approximately random", you might
be able to use the primary key as a pseudo-random value.  Again, see
prior discussion.

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: Joseph Shraibman
Дата:
Сообщение: Re: NFS performance tuning
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: Function to convert