Re: TABLESAMPLE doesn't actually satisfy the SQL spec, does it?

Поиск
Список
Период
Сортировка
От Petr Jelinek
Тема Re: TABLESAMPLE doesn't actually satisfy the SQL spec, does it?
Дата
Msg-id 55A7B6AA.20008@2ndquadrant.com
обсуждение исходный текст
Ответ на TABLESAMPLE doesn't actually satisfy the SQL spec, does it?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: TABLESAMPLE doesn't actually satisfy the SQL spec, does it?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 2015-07-12 18:02, Tom Lane wrote:
>
> A possible way around this problem is to redefine the sampling rule so
> that it is not history-dependent but depends only on the tuple TIDs.
> For instance, one could hash the TID of a candidate tuple, xor that with
> a hash of the seed being used for the current query, and then select the
> tuple if (hash/MAXINT) < P.
>

That would work for bernoulli for physical tuples, yes. Only thing that 
worries me is future extensibility for data sources that only provide 
virtual tuples.

--  Petr Jelinek                  http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training &
Services



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

Предыдущее
От: Fujii Masao
Дата:
Сообщение: Volatility of pg_xact_commit_timestamp() and pg_last_committed_xact()
Следующее
От: Tom Lane
Дата:
Сообщение: Re: TABLESAMPLE patch is really in pretty sad shape