Re: Best way to return Random rows from a table with non-repeatability of rows
В списке pgsql-general по дате отправления:
| От | Chris Mair |
|---|---|
| Тема | Re: Best way to return Random rows from a table with non-repeatability of rows |
| Дата | |
| Msg-id | bc1cc5454658a4fff6f3779645098576@smtp.hushmail.com обсуждение |
| Ответ на | Best way to return Random rows from a table with non-repeatability of rows (Kiran <bangalore.kiran@gmail.com>) |
| Ответы |
Re: Best way to return Random rows from a table with
non-repeatability of rows
|
| Список | pgsql-general |
> Dear folks, > > I have a table with thousands of rows ( currently 15 thousand but will grow very fast). > I need to return from the query rows which are random and non-repeating. > I know there is random() function, but would like to know from postgresql practitioners before embarking that path. > Please let me know what is best way to handle this type of queries. > > regards > Kiran Hi, if you're using Postgres >= 9.5 what you are looking for is TABLESAMPLE. Syntax is here: https://www.postgresql.org/docs/9.5/static/sql-select.html Google tablesample+postgres to get some examples on how to use it. Bye, Chris.
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера