{"Entry":{"collection":"plan","key":"tid-range-scan","name":"Tid Range Scan","aliases":["T_TidRangeScan","Tid Range Scan","TidRangeScan"],"metadata":{"aliases":["T_TidRangeScan","Tid Range Scan","TidRangeScan"],"category":"Scan","content_hash":"a0fbec00e321de32546acaa760891c2bcd32bbd4bdeef35bdc06ca231349d40c","imported_at":"2026-09-30T00:40:44.266438+08:00","name":"Tid Range Scan","name_zh":"TidRangeScan","slug":"tid-range-scan","summary":"Scans a relation over a range of tuple identifiers."}},"Definition":{"Collection":"plan","Key":"tid-range-scan","SourceDatabase":"center","Version":"18","SourceTable":"plan_node","SourceKey":"tid-range-scan","SourceRevision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","Facts":{"comparison_data":{"initializer":"ExecInitTidRangeScan","memory_mechanism":"unclassified","node_tag":"T_TidRangeScan","parallel_callbacks":[],"partial_modes":[],"strategies":[],"text_names":["Tid Range Scan"]},"comparison_hash":"fc2e690009eada98b87b1cebea56efd35a688fbd53c168572df67f03a1bde70e","description":["Scans a relation over a range of tuple identifiers."],"evidence_kind":"source and documentation","explain_names":["Tid Range Scan"],"explain_prefixes":["Parallel","Async"],"facts":[{"label":"Core node tag","value":"T_TidRangeScan"},{"label":"Structured EXPLAIN Node Type","value":"Tid Range Scan"},{"label":"Inputs","value":"A relation and tuple-identifier bounds"},{"label":"Output","value":"Selected table tuples"},{"label":"Executor initializer","value":"ExecInitTidRangeScan"},{"label":"Memory mechanism","value":"unclassified"}],"memory":{"description":"This extraction does not assign a universal memory limit or spill policy to this node. Inspect the same-build implementation and its expressions or provider.","evidence":[{"archive_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","label":"src/backend/executor/nodeTidrangescan.c","path":"src/backend/executor/nodeTidrangescan.c","sha256":"2cc328fc19284accf5f67759b67cd54656ed615fdd7c8725eccda9e3bc74b4d7","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"}],"mechanism":"unclassified","source_notes":[]},"node_tag":"T_TidRangeScan","parallel_callbacks":[],"partial_modes":[],"related":[{"label":"EXPLAIN","url":"/wiki/sql/explain/?v=18"},{"label":"Using EXPLAIN","url":"/docs/18/using-explain.html"},{"label":"Parallel plans","url":"/docs/18/parallel-plans.html"},{"label":"enable_tidscan","url":"/wiki/guc/enable_tidscan/?v=18"}],"release":{"channel":"stable","label":"18.6","major":"18","ref":"PostgreSQL 18.6 source archive","revision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","source_snapshot_utc":"","source_url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"},"runtime_verified":false,"sections":[{"paragraphs":["Structured formats use the Node Type above. Text-format spellings can also include operation, strategy, join type, scan direction or aggregation-stage attributes.","Text names recorded by this source: Tid Range Scan.","Parallel-aware and parallel-safe are different plan properties. A node running inside a parallel worker is not necessarily a parallel-aware node."],"title":"EXPLAIN names and attributes"},{"paragraphs":["This extraction does not assign a universal memory limit or spill policy to this node. Inspect the same-build implementation and its expressions or provider."],"title":"Memory and temporary storage"},{"paragraphs":["The source callbacks below can coordinate execution or collect worker instrumentation. Their presence is not a blanket claim that this node supports a shared parallel scan or shared state.","Callbacks in this build: none extracted from this node implementation."],"title":"Parallel execution and instrumentation"},{"paragraphs":["nodeTidrangescan.c Routines to support TID range scans of relations","It's sufficient to check varattno to identify the CTID variable, as any Var in the relation scan qual must be for our table. (Even if it's a parameterized scan referencing some other table's CTID, the other table's Var would have become a Param by the time it gets here.)","For the given 'expr', build and return an appropriate TidOpExpr taking into account the expr's operator and operand order.","Extract the qual subexpressions that yield TIDs to search for, and compile them into ExprStates if they're ordinary expressions.","Compute and set node's block and offset range to scan by evaluating node-\u003etrss_tidexprs. Returns false if we detect the range cannot contain any tuples. Returns true if it's possible for the range to contain tuples. We don't bother validating that trss_mintid is less than or equal to trss_maxtid, as the scan_set_tidrange() table AM function will handle that."],"title":"Executor implementation notes"},{"code":"case T_TidRangeScan:\n\t\t\tpname = sname = \"Tid Range Scan\";\n\t\t\tbreak;","title":"EXPLAIN identity in core source"}],"source_inventory":{"executor":"src/backend/executor/execProcnode.c","explain":"src/backend/commands/explain.c","implementation":"src/backend/executor/nodeTidrangescan.c"},"sources":[{"archive_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","label":"src/backend/commands/explain.c:1459","line":1459,"path":"src/backend/commands/explain.c","sha256":"34c86d6070224a0e981efef51f79101d6d505e5874f1684ace183034bab14bb4","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"},{"archive_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","label":"src/backend/executor/execProcnode.c:244","line":244,"path":"src/backend/executor/execProcnode.c","sha256":"f8a06a3f539077249b20664b2812433db6d7bd12b2c0ca633525db43d06f112a","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"},{"archive_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","label":"src/backend/executor/nodeTidrangescan.c","path":"src/backend/executor/nodeTidrangescan.c","sha256":"2cc328fc19284accf5f67759b67cd54656ed615fdd7c8725eccda9e3bc74b4d7","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"},{"archive_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","label":"src/include/nodes/plannodes.h","path":"src/include/nodes/plannodes.h","sha256":"52422b327a8049fbbb20d8b96008a0fc0a6fafa60f7eff3c695d5b2e83830120","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"}],"strategies":[],"tables":[{"columns":[{"key":"label","label":"Text-format label"},{"key":"identity","label":"Structured node identity"}],"key":"explain-labels","rows":[{"identity":"Tid Range Scan","label":"Tid Range Scan"}],"title":"EXPLAIN labels in this source build"}]},"ManualEvidence":{"release":{"channel":"stable","label":"18.6","major":"18","ref":"PostgreSQL 18.6 source archive","revision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","source_snapshot_utc":"","source_url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"},"sources":[{"archive_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","label":"src/backend/commands/explain.c:1459","line":1459,"path":"src/backend/commands/explain.c","sha256":"34c86d6070224a0e981efef51f79101d6d505e5874f1684ace183034bab14bb4","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"},{"archive_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","label":"src/backend/executor/execProcnode.c:244","line":244,"path":"src/backend/executor/execProcnode.c","sha256":"f8a06a3f539077249b20664b2812433db6d7bd12b2c0ca633525db43d06f112a","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"},{"archive_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","label":"src/backend/executor/nodeTidrangescan.c","path":"src/backend/executor/nodeTidrangescan.c","sha256":"2cc328fc19284accf5f67759b67cd54656ed615fdd7c8725eccda9e3bc74b4d7","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"},{"archive_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","label":"src/include/nodes/plannodes.h","path":"src/include/nodes/plannodes.h","sha256":"52422b327a8049fbbb20d8b96008a0fc0a6fafa60f7eff3c695d5b2e83830120","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"}]},"MeasuredEvidence":{"runtime_verified":false}},"Text":{"Collection":"plan","Key":"tid-range-scan","SourceDatabase":"center","Version":"18","Locale":"en","Title":"Tid Range Scan","Summary":"Scans a relation over a range of tuple identifiers.","BodyHTML":"\u003cp\u003eScans a relation over a range of tuple identifiers.\u003c/p\u003e","SourceRevision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","ContentHash":"c8bc2da42fff1f36972e4ab13b5cdab522969fa3f92db5c5aad0e2d3ff87c43f","Payload":{"description":["Scans a relation over a range of tuple identifiers."],"related":[{"label":"EXPLAIN","url":"/wiki/sql/explain/?v=18"},{"label":"Using EXPLAIN","url":"/docs/18/using-explain.html"},{"label":"Parallel plans","url":"/docs/18/parallel-plans.html"},{"label":"enable_tidscan","url":"/wiki/guc/enable_tidscan/?v=18"}],"sections":[{"paragraphs":["Structured formats use the Node Type above. Text-format spellings can also include operation, strategy, join type, scan direction or aggregation-stage attributes.","Text names recorded by this source: Tid Range Scan.","Parallel-aware and parallel-safe are different plan properties. A node running inside a parallel worker is not necessarily a parallel-aware node."],"title":"EXPLAIN names and attributes"},{"paragraphs":["This extraction does not assign a universal memory limit or spill policy to this node. Inspect the same-build implementation and its expressions or provider."],"title":"Memory and temporary storage"},{"paragraphs":["The source callbacks below can coordinate execution or collect worker instrumentation. Their presence is not a blanket claim that this node supports a shared parallel scan or shared state.","Callbacks in this build: none extracted from this node implementation."],"title":"Parallel execution and instrumentation"},{"paragraphs":["nodeTidrangescan.c Routines to support TID range scans of relations","It's sufficient to check varattno to identify the CTID variable, as any Var in the relation scan qual must be for our table. (Even if it's a parameterized scan referencing some other table's CTID, the other table's Var would have become a Param by the time it gets here.)","For the given 'expr', build and return an appropriate TidOpExpr taking into account the expr's operator and operand order.","Extract the qual subexpressions that yield TIDs to search for, and compile them into ExprStates if they're ordinary expressions.","Compute and set node's block and offset range to scan by evaluating node-\u003etrss_tidexprs. Returns false if we detect the range cannot contain any tuples. Returns true if it's possible for the range to contain tuples. We don't bother validating that trss_mintid is less than or equal to trss_maxtid, as the scan_set_tidrange() table AM function will handle that."],"title":"Executor implementation notes"},{"code":"case T_TidRangeScan:\n\t\t\tpname = sname = \"Tid Range Scan\";\n\t\t\tbreak;","title":"EXPLAIN identity in core source"}],"tables":[{"columns":[{"key":"label","label":"Text-format label"},{"key":"identity","label":"Structured node identity"}],"key":"explain-labels","rows":[{"identity":"Tid Range Scan","label":"Tid Range Scan"}],"title":"EXPLAIN labels in this source build"}]}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["14","15","16","17","18","19","20"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
