{"Entry":{"collection":"plan","key":"bitmap-heap-scan","name":"Bitmap Heap Scan","aliases":["Bitmap Heap Scan","BitmapHeapScan","T_BitmapHeapScan"],"metadata":{"aliases":["Bitmap Heap Scan","BitmapHeapScan","T_BitmapHeapScan"],"category":"Scan","content_hash":"f367ec0c2e303f54fe421e2de5843b2f1b11e9e76c9ff4dd8073d1b0de9525ed","derived_content_hash":"981ec0f7a4147d9a91ea397c1e5d679bee5c208fab139a9a62a545003c41f8d3","imported_at":"2026-09-30T00:40:44.204953+08:00","name":"Bitmap Heap Scan","name_zh":"BitmapHeapScan","slug":"bitmap-heap-scan","summary":"Visits heap pages selected by a bitmap and performs required rechecks."}},"Definition":{"Collection":"plan","Key":"bitmap-heap-scan","SourceDatabase":"center","Version":"18","SourceTable":"plan_node","SourceKey":"bitmap-heap-scan","SourceRevision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","Facts":{"comparison_data":{"initializer":"ExecInitBitmapHeapScan","memory_mechanism":"unclassified","node_tag":"T_BitmapHeapScan","parallel_callbacks":["ExecBitmapHeapEstimate","ExecBitmapHeapInitializeDSM","ExecBitmapHeapInitializeWorker","ExecBitmapHeapReInitializeDSM","ExecBitmapHeapRetrieveInstrumentation"],"partial_modes":[],"strategies":[],"text_names":["Bitmap Heap Scan"]},"comparison_hash":"f7ee070f7f36c2ed7f3e237eb0933d70972eaf9860d38070438efebcf8ec6e71","description":["Visits heap pages selected by a bitmap and performs required rechecks."],"description_zh":"根据位图访问堆页面并执行必要的条件复查。","description_zh_html":"\u003cp\u003e根据位图访问堆页面并执行必要的条件复查。\u003c/p\u003e\u003cp\u003e核心节点标识：\u003ccode\u003eT_BitmapHeapScan\u003c/code\u003e；EXPLAIN 名称：\u003ccode\u003eBitmap Heap Scan\u003c/code\u003e。\u003c/p\u003e\u003cp\u003e本版本源码中的并行执行或观测回调：\u003ccode\u003eExecBitmapHeapEstimate, ExecBitmapHeapInitializeDSM, ExecBitmapHeapInitializeWorker, ExecBitmapHeapReInitializeDSM, ExecBitmapHeapRetrieveInstrumentation\u003c/code\u003e。回调的存在不表示该节点必然支持共享并行扫描；在并行工作进程中执行也不等于具有并行感知能力。\u003c/p\u003e\u003ch3\u003e同版本中文手册节选\u003c/h3\u003e\u003cp\u003e\n    目前支持下列类型的并行感知表扫描。\n\n  \u003c/p\u003e\u003cp\u003e\n\n    其他扫描类型，例如非 B-树索引扫描，将来也可能支持并行扫描。\n  \u003c/p\u003e\u003cp\u003e\u003ca href=\"/zh/docs/18/parallel-plans.html#PARALLEL-SCANS\"\u003e查看完整中文手册与上下文\u003c/a\u003e。\u003c/p\u003e\u003cp\u003e本页开头的中文说明为 PG.CENTER 对编辑说明的翻译；手册节选保留对应版本中文文档原文。源码信息及手册示例不代表重新进行过运行测试。\u003c/p\u003e","evidence_kind":"source and documentation","explain_names":["Bitmap Heap Scan"],"explain_prefixes":["Parallel","Async"],"facts":[{"label":"Core node tag","value":"T_BitmapHeapScan"},{"label":"Structured EXPLAIN Node Type","value":"Bitmap Heap Scan"},{"label":"Inputs","value":"A tuple-location bitmap and relation"},{"label":"Output","value":"Qualified heap tuples"},{"label":"Executor initializer","value":"ExecInitBitmapHeapScan"},{"label":"Memory mechanism","value":"unclassified"}],"facts_zh":[{"label":"核心节点标签","value":"T_BitmapHeapScan"},{"label":"结构化 EXPLAIN 节点类型","value":"Bitmap Heap Scan"},{"label":"输入","value":"元组位置位图及关系"},{"label":"输出","value":"满足条件的堆元组"},{"label":"执行器初始化函数","value":"ExecInitBitmapHeapScan"},{"label":"内存机制","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/nodeBitmapHeapscan.c","path":"src/backend/executor/nodeBitmapHeapscan.c","sha256":"0c49bbf89f6614af08dbcea2a1776abc79db23e523e8c1fc852a42215f202206","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"}],"mechanism":"unclassified","source_notes":["If we are using lossy info, we have to recheck the qual conditions at every tuple."]},"node_tag":"T_BitmapHeapScan","parallel_callbacks":["ExecBitmapHeapEstimate","ExecBitmapHeapInitializeDSM","ExecBitmapHeapInitializeWorker","ExecBitmapHeapReInitializeDSM","ExecBitmapHeapRetrieveInstrumentation"],"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_bitmapscan","url":"/wiki/guc/enable_bitmapscan/?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: Bitmap Heap 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.","If we are using lossy info, we have to recheck the qual conditions at every tuple."],"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: ExecBitmapHeapEstimate, ExecBitmapHeapInitializeDSM, ExecBitmapHeapInitializeWorker, ExecBitmapHeapReInitializeDSM, ExecBitmapHeapRetrieveInstrumentation."],"title":"Parallel execution and instrumentation"},{"paragraphs":["In a parallel bitmap heap scan , one process is chosen as the leader. That process performs a scan of one or more indexes and builds a bitmap indicating which table blocks need to be visited. These blocks are then divided among the cooperating processes as in a parallel sequential scan. In other words, the heap scan is performed in parallel, but the underlying index scan is not."],"title":"Same-version manual discussion"},{"blocks":[{"code":"EXPLAIN SELECT * FROM tenk1 WHERE unique1 \u003c 100;\n\n                                  QUERY PLAN\n------------------------------------------------------------------------------\n Bitmap Heap Scan on tenk1  (cost=5.06..224.98 rows=100 width=244)\n   Recheck Cond: (unique1 \u003c 100)\n   -\u003e  Bitmap Index Scan on tenk1_unique1  (cost=0.00..5.04 rows=100 width=0)\n         Index Cond: (unique1 \u003c 100)","paragraphs":["Example copied from the PostgreSQL 18.6 manual; it was not executed for this collection.","Now, let's make the condition more restrictive:"],"source":{"label":"PostgreSQL 18.6 · using-explain","path":"using-explain.html","sha256":"60040c30180093418a0affe56dd27dff9df2504b705b38039589e458bf5c31ed","url":"/docs/18/using-explain.html#USING-EXPLAIN-BASICS"}},{"code":"EXPLAIN SELECT * FROM tenk1 WHERE unique1 \u003c 100 AND stringu1 = 'xxx';\n\n                                  QUERY PLAN\n------------------------------------------------------------------------------\n Bitmap Heap Scan on tenk1  (cost=5.04..225.20 rows=1 width=244)\n   Recheck Cond: (unique1 \u003c 100)\n   Filter: (stringu1 = 'xxx'::name)\n   -\u003e  Bitmap Index Scan on tenk1_unique1  (cost=0.00..5.04 rows=100 width=0)\n         Index Cond: (unique1 \u003c 100)","paragraphs":["Example copied from the PostgreSQL 18.6 manual; it was not executed for this collection.","Now let's add another condition to the WHERE clause:"],"source":{"label":"PostgreSQL 18.6 · using-explain","path":"using-explain.html","sha256":"60040c30180093418a0affe56dd27dff9df2504b705b38039589e458bf5c31ed","url":"/docs/18/using-explain.html#USING-EXPLAIN-BASICS"}}],"title":"Examples from this manual build"},{"paragraphs":["nodeBitmapHeapscan.c Routines to support bitmapped scans of relations","NOTE: it is critical that this plan type only be used with MVCC-compliant snapshots (ie, regular snapshots, not SnapshotAny or one of the other special snapshots). The reason is that since index and heap scans are decoupled, there can be no assurance that the index tuple prompting a visit to a particular heap TID still exists when the visit is made. Therefore the tuple might not exist anymore either (which is OK because heap_fetch will cope) --- but worse, the tuple slot could have been re-used for a newer tuple. With an MVCC snapshot the newer tuple is certain to fail the time qual and so it will not be mistakenly returned, but with anything else we might return a tuple that doesn't meet the required index qual conditions.","Do the underlying index scan, build the bitmap, set up the parallel state needed for parallel workers to iterate through the bitmap, and set up the underlying table scan descriptor.","The leader will immediately come out of the function, but others will be blocked until leader populates the TBM and wakes them up.","Prepare to iterate over the TBM. This will return the dsa_pointer of the iterator state which will be used by multiple processes to iterate jointly."],"title":"Executor implementation notes"},{"code":"case T_BitmapHeapScan:\n\t\t\tpname = sname = \"Bitmap Heap Scan\";\n\t\t\tbreak;","title":"EXPLAIN identity in core source"}],"sections_zh":[{"paragraphs":["结构化格式使用上述 Node Type。文本格式名称还可能包含操作、策略、连接类型、扫描方向或聚合阶段属性。","此源码记录的文本名称：Bitmap Heap Scan.","并行感知与并行安全是不同的计划属性。在并行工作进程内运行的节点不一定是并行感知节点。"],"title":"EXPLAIN 名称与属性"},{"paragraphs":["本次抽取不为此节点设定统一的内存上限或落盘策略。请查看同一构建的实现、相关表达式或提供方。","使用有损信息时，必须对每个元组重新检查条件。"],"title":"内存与临时存储"},{"paragraphs":["以下源码回调可以协调执行或收集工作进程的测量数据。回调存在不代表该节点普遍支持共享并行扫描或共享状态。","此构建的回调：ExecBitmapHeapEstimate, ExecBitmapHeapInitializeDSM, ExecBitmapHeapInitializeWorker, ExecBitmapHeapReInitializeDSM, ExecBitmapHeapRetrieveInstrumentation."],"title":"并行执行与运行信息采集"},{"paragraphs":["在 并行位图堆扫描 中，会选择一个进程作为领导者。该进程执行一个或多个索引扫描，并构建一个位图，以指示需要访问哪些表块。然后这些块会像并行顺序扫描那样分配给协作进程。换句话说，堆扫描是并行执行的，但底层索引扫描不是。"],"title":"同版本手册说明"},{"blocks":[{"code":"EXPLAIN SELECT * FROM tenk1 WHERE unique1 \u003c 100;\n\n                                  QUERY PLAN\n------------------------------------------------------------------------------\n Bitmap Heap Scan on tenk1  (cost=5.06..224.98 rows=100 width=244)\n   Recheck Cond: (unique1 \u003c 100)\n   -\u003e  Bitmap Index Scan on tenk1_unique1  (cost=0.00..5.04 rows=100 width=0)\n         Index Cond: (unique1 \u003c 100)","paragraphs":["示例摘自 PostgreSQL 18.6 手册；本百科未实际执行此示例。","现在进一步收紧条件："],"source":{"label":"PostgreSQL 18.6 · using-explain","path":"using-explain.html","sha256":"60040c30180093418a0affe56dd27dff9df2504b705b38039589e458bf5c31ed","url":"/docs/18/using-explain.html#USING-EXPLAIN-BASICS"}},{"code":"EXPLAIN SELECT * FROM tenk1 WHERE unique1 \u003c 100 AND stringu1 = 'xxx';\n\n                                  QUERY PLAN\n------------------------------------------------------------------------------\n Bitmap Heap Scan on tenk1  (cost=5.04..225.20 rows=1 width=244)\n   Recheck Cond: (unique1 \u003c 100)\n   Filter: (stringu1 = 'xxx'::name)\n   -\u003e  Bitmap Index Scan on tenk1_unique1  (cost=0.00..5.04 rows=100 width=0)\n         Index Cond: (unique1 \u003c 100)","paragraphs":["示例摘自 PostgreSQL 18.6 手册；本百科未实际执行此示例。","现在向 WHERE 子句再添加一个条件："],"source":{"label":"PostgreSQL 18.6 · using-explain","path":"using-explain.html","sha256":"60040c30180093418a0affe56dd27dff9df2504b705b38039589e458bf5c31ed","url":"/docs/18/using-explain.html#USING-EXPLAIN-BASICS"}}],"title":"本版手册中的示例"},{"paragraphs":["nodeBitmapHeapscan.c：支持关系位图扫描的例程。","注意：此计划类型必须仅使用符合 MVCC 的快照，即普通快照，而非 SnapshotAny 或其他特殊快照。索引扫描与堆扫描相互分离，访问某个堆 TID 时，无法保证促成该访问的索引元组仍然存在。堆元组可能已经消失（heap_fetch 能处理这种情况），更严重的是，其位置可能已被更新的元组复用。使用 MVCC 快照时，新元组必定无法通过时间可见性检查，因此不会错误返回；使用其他快照则可能返回不符合索引条件的元组。","执行底层索引扫描并构建位图，设置并行工作进程迭代位图所需的并行状态，以及底层表扫描描述符。","领导进程会立即退出该函数，其他进程则阻塞，直到领导进程填充 TBM 并唤醒它们。","准备遍历 TBM，返回迭代器状态的 dsa_pointer，供多个进程共同遍历。"],"title":"执行器实现说明"},{"code":"case T_BitmapHeapScan:\n\t\t\tpname = sname = \"Bitmap Heap Scan\";\n\t\t\tbreak;","title":"核心源码中的 EXPLAIN 标识"}],"source_inventory":{"executor":"src/backend/executor/execProcnode.c","explain":"src/backend/commands/explain.c","implementation":"src/backend/executor/nodeBitmapHeapscan.c"},"sources":[{"archive_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","label":"src/backend/commands/explain.c:1453","line":1453,"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:234","line":234,"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/nodeBitmapHeapscan.c","path":"src/backend/executor/nodeBitmapHeapscan.c","sha256":"0c49bbf89f6614af08dbcea2a1776abc79db23e523e8c1fc852a42215f202206","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"},{"label":"PostgreSQL 18.6 · parallel-plans","path":"parallel-plans.html","sha256":"62207d207bead82b01b59dc119c4f95856f08655cc11d4699a05a40867ed2070","url":"/docs/18/parallel-plans.html#PARALLEL-SCANS"},{"label":"PostgreSQL 18.6 · using-explain","path":"using-explain.html","sha256":"60040c30180093418a0affe56dd27dff9df2504b705b38039589e458bf5c31ed","url":"/docs/18/using-explain.html#USING-EXPLAIN-BASICS"}],"strategies":[],"tables":[{"columns":[{"key":"label","label":"Text-format label"},{"key":"identity","label":"Structured node identity"}],"key":"explain-labels","rows":[{"identity":"Bitmap Heap Scan","label":"Bitmap Heap Scan"}],"title":"EXPLAIN labels in this source build"}],"tables_zh":[{"columns":[{"key":"label","label":"文本格式标签"},{"key":"identity","label":"结构化节点标识"}],"key":"explain-labels","rows":[{"identity":"Bitmap Heap Scan","label":"Bitmap Heap Scan"}],"title":"本构建中的 EXPLAIN 标签"}],"zh_from":{"authored_translation":"authored-translation-of-reviewed-guidance","body_sha256":"fae0739410a91e9ed01474f21cc54cb25a8ef638b28bd963602cc7f43f23a079","kind":"same-version-chinese-manual-with-authored-translation-of-reviewed-guidance","manual":{"anchor":"PARALLEL-SCANS","build_id":107,"extraction":"concept-introduction","fragment_sha256":"3b48b5d906c8a2962d185a0646867a8cfadf7c8f90a06899f31c774a09d09852","locale":"zh-Hans","page_key":"parallel-plans.html","source_hash":"1ef9f9a3740440f8dcdf04c2a2dfe2f7d48c66f2e0b102d15df580bff22a6857","source_revision":"unknown:rendered-translation-baseline","translated_from_revision":null,"translation_revision":"git:b1b500221dbe5437cfca004d6b04d3f6e422765d;html-sha256:08e987a66af27b98444a8057c256314eafa13611a3fb9e888214fc436824244b","url":"/zh/docs/18/parallel-plans.html#PARALLEL-SCANS","version":"18"},"runtime_rerun":false,"source_facts_revision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"}},"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:1453","line":1453,"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:234","line":234,"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/nodeBitmapHeapscan.c","path":"src/backend/executor/nodeBitmapHeapscan.c","sha256":"0c49bbf89f6614af08dbcea2a1776abc79db23e523e8c1fc852a42215f202206","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"},{"label":"PostgreSQL 18.6 · parallel-plans","path":"parallel-plans.html","sha256":"62207d207bead82b01b59dc119c4f95856f08655cc11d4699a05a40867ed2070","url":"/docs/18/parallel-plans.html#PARALLEL-SCANS"},{"label":"PostgreSQL 18.6 · using-explain","path":"using-explain.html","sha256":"60040c30180093418a0affe56dd27dff9df2504b705b38039589e458bf5c31ed","url":"/docs/18/using-explain.html#USING-EXPLAIN-BASICS"}]},"MeasuredEvidence":{"runtime_verified":false}},"Text":{"Collection":"plan","Key":"bitmap-heap-scan","SourceDatabase":"center","Version":"18","Locale":"en","Title":"Bitmap Heap Scan","Summary":"Visits heap pages selected by a bitmap and performs required rechecks.","BodyHTML":"\u003cp\u003eVisits heap pages selected by a bitmap and performs required rechecks.\u003c/p\u003e","SourceRevision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","ContentHash":"67a240ed1df6440b294a8b9b0af0daac83d630bea5b35a673d8cfb668e8ce5bb","Payload":{"description":["Visits heap pages selected by a bitmap and performs required rechecks."],"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_bitmapscan","url":"/wiki/guc/enable_bitmapscan/?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: Bitmap Heap 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.","If we are using lossy info, we have to recheck the qual conditions at every tuple."],"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: ExecBitmapHeapEstimate, ExecBitmapHeapInitializeDSM, ExecBitmapHeapInitializeWorker, ExecBitmapHeapReInitializeDSM, ExecBitmapHeapRetrieveInstrumentation."],"title":"Parallel execution and instrumentation"},{"paragraphs":["In a parallel bitmap heap scan , one process is chosen as the leader. That process performs a scan of one or more indexes and builds a bitmap indicating which table blocks need to be visited. These blocks are then divided among the cooperating processes as in a parallel sequential scan. In other words, the heap scan is performed in parallel, but the underlying index scan is not."],"title":"Same-version manual discussion"},{"blocks":[{"code":"EXPLAIN SELECT * FROM tenk1 WHERE unique1 \u003c 100;\n\n                                  QUERY PLAN\n------------------------------------------------------------------------------\n Bitmap Heap Scan on tenk1  (cost=5.06..224.98 rows=100 width=244)\n   Recheck Cond: (unique1 \u003c 100)\n   -\u003e  Bitmap Index Scan on tenk1_unique1  (cost=0.00..5.04 rows=100 width=0)\n         Index Cond: (unique1 \u003c 100)","paragraphs":["Example copied from the PostgreSQL 18.6 manual; it was not executed for this collection.","Now, let's make the condition more restrictive:"],"source":{"label":"PostgreSQL 18.6 · using-explain","path":"using-explain.html","sha256":"60040c30180093418a0affe56dd27dff9df2504b705b38039589e458bf5c31ed","url":"/docs/18/using-explain.html#USING-EXPLAIN-BASICS"}},{"code":"EXPLAIN SELECT * FROM tenk1 WHERE unique1 \u003c 100 AND stringu1 = 'xxx';\n\n                                  QUERY PLAN\n------------------------------------------------------------------------------\n Bitmap Heap Scan on tenk1  (cost=5.04..225.20 rows=1 width=244)\n   Recheck Cond: (unique1 \u003c 100)\n   Filter: (stringu1 = 'xxx'::name)\n   -\u003e  Bitmap Index Scan on tenk1_unique1  (cost=0.00..5.04 rows=100 width=0)\n         Index Cond: (unique1 \u003c 100)","paragraphs":["Example copied from the PostgreSQL 18.6 manual; it was not executed for this collection.","Now let's add another condition to the WHERE clause:"],"source":{"label":"PostgreSQL 18.6 · using-explain","path":"using-explain.html","sha256":"60040c30180093418a0affe56dd27dff9df2504b705b38039589e458bf5c31ed","url":"/docs/18/using-explain.html#USING-EXPLAIN-BASICS"}}],"title":"Examples from this manual build"},{"paragraphs":["nodeBitmapHeapscan.c Routines to support bitmapped scans of relations","NOTE: it is critical that this plan type only be used with MVCC-compliant snapshots (ie, regular snapshots, not SnapshotAny or one of the other special snapshots). The reason is that since index and heap scans are decoupled, there can be no assurance that the index tuple prompting a visit to a particular heap TID still exists when the visit is made. Therefore the tuple might not exist anymore either (which is OK because heap_fetch will cope) --- but worse, the tuple slot could have been re-used for a newer tuple. With an MVCC snapshot the newer tuple is certain to fail the time qual and so it will not be mistakenly returned, but with anything else we might return a tuple that doesn't meet the required index qual conditions.","Do the underlying index scan, build the bitmap, set up the parallel state needed for parallel workers to iterate through the bitmap, and set up the underlying table scan descriptor.","The leader will immediately come out of the function, but others will be blocked until leader populates the TBM and wakes them up.","Prepare to iterate over the TBM. This will return the dsa_pointer of the iterator state which will be used by multiple processes to iterate jointly."],"title":"Executor implementation notes"},{"code":"case T_BitmapHeapScan:\n\t\t\tpname = sname = \"Bitmap Heap 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":"Bitmap Heap Scan","label":"Bitmap Heap Scan"}],"title":"EXPLAIN labels in this source build"}]}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
