Re: Selecting random rows efficiently

Поиск
Список
Период
Сортировка
От Rod Taylor
Тема Re: Selecting random rows efficiently
Дата
Msg-id 1062252117.83670.29.camel@jester
обсуждение исходный текст
Ответ на Re: Selecting random rows efficiently  (Richard Jones <rj@last.fm>)
Ответы Re: Selecting random rows efficiently  (Ron Johnson <ron.l.johnson@cox.net>)
Список pgsql-performance
> i was hoping there was some trickery with sequences that would allow me to
> easily pick a random valid sequence number..?

I would suggest renumbering the data.

ALTER SEQUENCE ... RESTART WITH 1;
UPDATE table SET pkey = DEFAULT;

Of course, PostgreSQL may have trouble with that update due to
evaluation of the unique constraint immediately -- so drop the primary
key first, and add it back after.

Вложения

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

Предыдущее
От: Rod Taylor
Дата:
Сообщение: Re: Hardware recommendations to scale to silly load
Следующее
От: Ron Johnson
Дата:
Сообщение: Re: Selecting random rows efficiently