Re: TABLESAMPLE patch

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: TABLESAMPLE patch
Дата
Msg-id 552823EB.5090408@gmx.net
обсуждение исходный текст
Ответ на Re: TABLESAMPLE patch  (Petr Jelinek <petr@2ndquadrant.com>)
Ответы Re: TABLESAMPLE patch  (Petr Jelinek <petr@2ndquadrant.com>)
Re: TABLESAMPLE patch  (Simon Riggs <simon@2ndQuadrant.com>)
Re: TABLESAMPLE patch  (Amit Kapila <amit.kapila16@gmail.com>)
Список pgsql-hackers
On 4/9/15 8:58 PM, Petr Jelinek wrote:
> Well, you can have two approaches to this, either allow some specific
> set of keywords that can be used to specify limit, or you let sampling
> methods interpret parameters, I believe the latter is more flexible.
> There is nothing stopping somebody writing sampling method which takes
> limit as number of rows, or anything else.
> 
> Also for example for BERNOULLI to work correctly you'd need to convert
> the number of rows to fraction of table anyway (and that's exactly what
> the one database which has this feature does internally) and then it's
> no different than passing (SELECT 100/reltuples*number_of_rows FROM
> tablename) as a parameter.

What is your intended use case for this feature?  I know that "give me
100 random rows from this table quickly" is a common use case, but
that's kind of cumbersome if you need to apply formulas like that.  I'm
not sure what the use of a percentage is.  Presumably, the main use of
this features is on large tables.  But then you might not even know how
large it really is, and even saying 0.1% might be more than you wanted
to handle.




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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: TABLESAMPLE patch
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: improving speed of make check-world