Re: TABLESAMPLE patch - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: TABLESAMPLE patch
Date
Msg-id CA+U5nMJCTrmJ+pJ=dS3RaBfKPzu8dGzZfbKeBWxs9h9N2ffTjQ@mail.gmail.com
Whole thread Raw
In response to Re: TABLESAMPLE patch  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: TABLESAMPLE patch
List pgsql-hackers
On 9 April 2015 at 04:52, Simon Riggs <simon@2ndquadrant.com> wrote:

> TABLESAMPLE BERNOULLI could work in this case, or any other non-block
> based sampling mechanism. Whether it does work yet is another matter.
>
> This query should be part of the test suite and should generate a
> useful message or work correctly.

The SQL Standard does allow the WITH query given. It makes no mention
of the obvious point that SYSTEM-defined mechanisms might not work,
but that is for the implementation to define, AFAICS.

The SQL Standard goes on to talk about "possibly non-deterministic"
issues. Which in Postgres relates to the point that the results of a
SampleScan will never be IMMUTABLE. That raises the possibility of
planner issues. We must, for example, never do inner join removal on a
sampled relation - we don't do that yet, but something to watch for.

On balance, in this release, I would be happier to exclude sampled
results from queries, and only allow sampling against base tables.

-- Simon Riggs                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, RemoteDBA, Training &
Services



pgsql-hackers by date:

Previous
From: Kyotaro HORIGUCHI
Date:
Subject: Re: How about to have relnamespace and relrole?
Next
From: Antonin Houska
Date:
Subject: Possible gaps/garbage in the output of XLOG reader