pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Simon Riggs <simon@2ndQuadrant.com>
To: pgsql-committers@postgresql.org
Subject: pgsql: TABLESAMPLE, SQL Standard and extensible
Date: Fri, 15 May 2015 18:38:48 +0000
Message-ID: <E1YtKVU-0001M2-1k@gemulon.postgresql.org> (raw )
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
TABLESAMPLE, SQL Standard and extensible
Add a TABLESAMPLE clause to SELECT statements that allows
user to specify random BERNOULLI sampling or block level
SYSTEM sampling. Implementation allows for extensible
sampling functions to be written, using a standard API.
Basic version follows SQLStandard exactly. Usable
concrete use cases for the sampling API follow in later
commits.
Petr Jelinek
Reviewed by Michael Paquier and Simon Riggs
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/f6d208d6e51810c73f0e02c477984a6b44627f11
Modified Files
--------------
contrib/file_fdw/file_fdw.c | 2 +-
contrib/postgres_fdw/postgres_fdw.c | 2 +-
doc/src/sgml/catalogs.sgml | 120 +++++++++
doc/src/sgml/ref/select.sgml | 61 ++++-
src/backend/access/Makefile | 3 +-
src/backend/access/heap/heapam.c | 41 ++-
src/backend/access/tablesample/Makefile | 17 ++
src/backend/access/tablesample/bernoulli.c | 235 ++++++++++++++++
src/backend/access/tablesample/system.c | 186 +++++++++++++
src/backend/access/tablesample/tablesample.c | 368 ++++++++++++++++++++++++++
src/backend/catalog/Makefile | 5 +-
src/backend/commands/analyze.c | 2 +-
src/backend/commands/explain.c | 21 ++
src/backend/executor/Makefile | 2 +-
src/backend/executor/execAmi.c | 8 +
src/backend/executor/execCurrent.c | 1 +
src/backend/executor/execProcnode.c | 14 +
src/backend/executor/nodeSamplescan.c | 256 ++++++++++++++++++
src/backend/nodes/copyfuncs.c | 60 +++++
src/backend/nodes/equalfuncs.c | 37 +++
src/backend/nodes/nodeFuncs.c | 28 ++
src/backend/nodes/outfuncs.c | 48 ++++
src/backend/nodes/readfuncs.c | 45 ++++
src/backend/optimizer/path/allpaths.c | 49 ++++
src/backend/optimizer/path/costsize.c | 67 +++++
src/backend/optimizer/plan/createplan.c | 69 +++++
src/backend/optimizer/plan/planner.c | 15 +-
src/backend/optimizer/plan/setrefs.c | 11 +
src/backend/optimizer/plan/subselect.c | 1 +
src/backend/optimizer/util/pathnode.c | 22 ++
src/backend/parser/gram.y | 36 ++-
src/backend/parser/parse_clause.c | 56 ++++
src/backend/parser/parse_func.c | 143 ++++++++++
src/backend/rewrite/rewriteHandler.c | 3 +
src/backend/utils/adt/ruleutils.c | 50 ++++
src/backend/utils/cache/lsyscache.c | 27 ++
src/backend/utils/cache/syscache.c | 23 ++
src/backend/utils/misc/sampling.c | 33 ++-
src/include/access/heapam.h | 4 +
src/include/access/relscan.h | 1 +
src/include/access/tablesample.h | 60 +++++
src/include/catalog/indexing.h | 5 +
src/include/catalog/pg_proc.h | 27 ++
src/include/catalog/pg_tablesample_method.h | 78 ++++++
src/include/executor/nodeSamplescan.h | 24 ++
src/include/nodes/execnodes.h | 9 +
src/include/nodes/nodes.h | 4 +
src/include/nodes/parsenodes.h | 37 +++
src/include/nodes/plannodes.h | 6 +
src/include/optimizer/cost.h | 1 +
src/include/optimizer/pathnode.h | 2 +
src/include/parser/kwlist.h | 1 +
src/include/parser/parse_func.h | 5 +
src/include/port.h | 4 +
src/include/utils/lsyscache.h | 1 +
src/include/utils/rel.h | 1 -
src/include/utils/sampling.h | 15 +-
src/include/utils/syscache.h | 2 +
src/port/erand48.c | 3 -
src/test/regress/expected/rowsecurity.out | 26 ++
src/test/regress/expected/sanity_check.out | 1 +
src/test/regress/expected/tablesample.out | 231 ++++++++++++++++
src/test/regress/parallel_schedule | 2 +-
src/test/regress/serial_schedule | 1 +
src/test/regress/sql/rowsecurity.sql | 4 +
src/test/regress/sql/tablesample.sql | 74 ++++++
66 files changed, 2756 insertions(+), 40 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
Message-ID: <E1YtKVU-0001M2-1k@gemulon.postgresql.org>
Permalink: ../E1YtKVU-0001M2-1k@gemulon.postgresql.org/
Also on: postgresql.org/message-id/E1YtKVU-0001M2-1k@gemulon.postgresql.org
copy link · copy postgr.es
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: simon@2ndQuadrant.com
Subject: Re: pgsql: TABLESAMPLE, SQL Standard and extensible
In-Reply-To: <E1YtKVU-0001M2-1k@gemulon.postgresql.org>
References: <E1YtKVU-0001M2-1k@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox