From bb437f995d47405ecd92cf66df71f7f7e40ed460 Mon Sep 17 00:00:00 2001 From: David Rowley Date: Sat, 27 Feb 2021 22:59:36 +1300 Subject: Add TID Range Scans to support efficient scanning ranges of TIDs This adds a new executor node named TID Range Scan. The query planner will generate paths for TID Range scans when quals are discovered on base relations which search for ranges on the table's ctid column. These ranges may be open at either end. For example, WHERE ctid >= '(10,0)'; will return all tuples on page 10 and over. To support this, two new optional callback functions have been added to table AM. scan_set_tidrange is used to set the scan range to just the given range of TIDs. scan_getnextslot_tidrange fetches the next tuple in the given range. For AMs were scanning ranges of TIDs would not make sense, these functions can be set to NULL in the TableAmRoutine. The query planner won't generate TID Range Scan Paths in that case. Author: Edmund Horner, David Rowley Reviewed-by: David Rowley, Tomas Vondra, Tom Lane, Andres Freund, Zhihong Yu Discussion: https://postgr.es/m/CAMyN-kB-nFTkF=VA_JPwFNo08S0d-Yk0F741S2B7LDmYAi8eyA@mail.gmail.com --- src/backend/executor/execCurrent.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/backend/executor/execCurrent.c') diff --git a/src/backend/executor/execCurrent.c b/src/backend/executor/execCurrent.c index 33221a4d6ce..4f430fb1603 100644 --- a/src/backend/executor/execCurrent.c +++ b/src/backend/executor/execCurrent.c @@ -336,6 +336,7 @@ search_plan_tree(PlanState *node, Oid table_oid, case T_IndexOnlyScanState: case T_BitmapHeapScanState: case T_TidScanState: + case T_TidRangeScanState: case T_ForeignScanState: case T_CustomScanState: { -- cgit v1.2.3