From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: tableam: sample scan.
Date: Mon, 01 Apr 2019 01:42:13 +0000
Message-ID: <E1hAlxl-0001xr-DK@gemulon.postgresql.org> (raw)
tableam: sample scan.
This moves sample scan support to below tableam. It's not optional as
there is, in contrast to e.g. bitmap heap scans, no alternative way to
perform tablesample queries. If an AM can't deal with the block based
API, it will have to throw an ERROR.
The tableam callbacks for this are block based, but given the current
TsmRoutine interface, that seems to be required.
The new interface doesn't require TsmRoutines to perform visibility
checks anymore - that requires the TsmRoutine to know details about
the AM, which we want to avoid. To continue to allow taking the
returned number of tuples account SampleScanState now has a donetuples
field (which previously e.g. existed in SystemRowsSamplerData), which
is only incremented after the visibility check succeeds.
Author: Andres Freund
Discussion: https://postgr.es/m/20180703070645.wchpu5muyto5n647@alap3.anarazel.de
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/73c954d24896aeb05de0f81d75e891a858e439e9
Modified Files
--------------
contrib/tsm_system_rows/tsm_system_rows.c | 86 ++---------
contrib/tsm_system_time/tsm_system_time.c | 13 +-
doc/src/sgml/tablesample-method.sgml | 9 +-
src/backend/access/heap/heapam_handler.c | 229 +++++++++++++++++++++++++++
src/backend/access/table/tableamapi.c | 3 +
src/backend/access/tablesample/system.c | 11 +-
src/backend/executor/nodeSamplescan.c | 249 ++++--------------------------
src/include/access/tableam.h | 88 +++++++++++
src/include/access/tsmapi.h | 3 +-
src/include/nodes/execnodes.h | 3 +
10 files changed, 382 insertions(+), 312 deletions(-)
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: andres@anarazel.de
Subject: Re: pgsql: tableam: sample scan.
In-Reply-To: <E1hAlxl-0001xr-DK@gemulon.postgresql.org>
References: <E1hAlxl-0001xr-DK@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