| От | cluster |
|---|---|
| Тема | Re: Selecting K random rows - efficiently! |
| Дата | |
| Msg-id | ffnid8$1q2t$1@news.hub.org обсуждение исходный текст |
| Ответ на | Re: Selecting K random rows - efficiently! (Martijn van Oosterhout <kleptog@svana.org>) |
| Список | pgsql-general |
> How important is true randomness?
The goal is an even distribution but currently I have not seen any way
to produce any kind of random sampling efficiently. Notice the word
"efficiently". The naive way of taking a random sample of size K:
(SELECT * FROM mydata ORDER BY random() LIMIT <K>)
is clearly not an option for performance reasons. It shouldn't be
necessary to explain why. :-)
> Search the archives, there have been solutions proposed before, though
> they probably arn't very quick...
As the subject suggests, performance really matters and searching the
archives only results in poor solutions (my first post explains why).
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера