Re: Feature request for count_estimate(samplesize) aggregate or SAMPLE keyword
В списке pgsql-general по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: Feature request for count_estimate(samplesize) aggregate or SAMPLE keyword |
| Дата | |
| Msg-id | 243115.1661996852@sss.pgh.pa.us обсуждение |
| Ответ на | Feature request for count_estimate(samplesize) aggregate or SAMPLE keyword (Torge <torgato@posteo.de>) |
| Ответы |
Re: Feature request for count_estimate(samplesize) aggregate or SAMPLE keyword
|
| Список | pgsql-general |
Torge <torgato@posteo.de> writes:
> Now I would like to humbly propose a feature that gives an easy way to
> get a quick count estimate for any condition - index based or not -
> based on a random sample of rows, that does not require a custom
> function creation or complex SQL statement
Can't you do that already using TABLESAMPLE? For example, to
use a 1% sample:
select count(*) * 100 from mytab tablesample system(1) where <condition>;
You do have to remember to multiply by the factor corresponding
to your sample rate, but aside from that annoyance this (a)
already exists, (b) is SQL-standard, and (c) can be adapted to
a lot of other kinds of analysis besides plain count(*).
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера