Re: TABLESAMPLE patch - Mailing list pgsql-hackers

From Tomas Vondra
Subject Re: TABLESAMPLE patch
Date
Msg-id 54EA7584.8050509@2ndquadrant.com
Whole thread Raw
In response to Re: TABLESAMPLE patch  (Petr Jelinek <petr@2ndquadrant.com>)
List pgsql-hackers
Hi,

On 22.2.2015 18:57, Petr Jelinek wrote:
> Tomas noticed that the patch is missing error check when TABLESAMPLE
> is used on view, so here is a new version that checks it's only used 
> against table or matview.
> 
> No other changes.

Curious question - could/should this use page prefetch, similar to what
bitmap heap scan does? I believe the answer is 'yes'.

With SYSTEM that should be rather straightforward to implement, because
it already works at page level, and it's likely to give significant
performance speedup, similar to bitmap index scan:

http://www.postgresql.org/message-id/CAHyXU0yiVvfQAnR9cyH=HWh1WbLRsioe=mzRJTHwtr=2azsTdQ@mail.gmail.com

With BERNOULLI that might be more complex to implement because of the
page/tuple sampling, and the benefit is probably much lower than for
SYSTEM because it's likely that at least one tuple will be sampled.

I'm not saying it has to be done in this CF (or that it makes the patch
uncommitable).

For example, this seems like a very nice project for the GSoC (clear
scope, not too large, ...).

-- 
Tomas Vondra                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: Abbreviated keys for text cost model fix
Next
From: Andrew Dunstan
Date:
Subject: Re: Allow "snapshot too old" error, to prevent bloat