This is an automated email from the ASF dual-hosted git repository. maxyang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/cloudberry.git
commit 5612f4b4d76a9313fbd67ec6b1bee0c35c2dc793 Author: zhoujiaqi <[email protected]> AuthorDate: Fri Dec 20 14:00:13 2024 +0800 Adapt dynamic (bitmap/index/table) scan to PG 14 In PG commit 36d22dd, if the ops in tableslot which returned by the current execution operator is fixed, the executor will simplify the call and directly call `*virt` functions. But in the dynamic (bitmap/index/table) scan operator, we don't know the tupleslot ops of the subtable (it may even be different). So the current change sets the `opsisfixed` of scan and result to false, which can prevent the executor from directly calling `*virt` funcstion. --- src/backend/executor/nodeDynamicBitmapHeapscan.c | 4 ++++ src/backend/executor/nodeDynamicBitmapIndexscan.c | 4 ++++ src/backend/executor/nodeDynamicIndexscan.c | 4 ++++ src/backend/executor/nodeDynamicSeqscan.c | 7 +++++++ 4 files changed, 19 insertions(+) diff --git a/src/backend/executor/nodeDynamicBitmapHeapscan.c b/src/backend/executor/nodeDynamicBitmapHeapscan.c index 2d731223eb..cf8c980d5d 100644 --- a/src/backend/executor/nodeDynamicBitmapHeapscan.c +++ b/src/backend/executor/nodeDynamicBitmapHeapscan.c @@ -68,6 +68,10 @@ ExecInitDynamicBitmapHeapScan(DynamicBitmapHeapScan *node, EState *estate, int e Relation scanRel = ExecOpenScanRelation(estate, node->bitmapheapscan.scan.scanrelid, eflags); ExecInitScanTupleSlot(estate, &state->ss, RelationGetDescr(scanRel), table_slot_callbacks(scanRel)); + /* Dynamic table/index/bitmap scan can't tell the ops of tupleslot */ + state->ss.ps.scanopsfixed = false; + state->ss.ps.scanopsset = true; + /* * Initialize result tuple type and projection info. */ diff --git a/src/backend/executor/nodeDynamicBitmapIndexscan.c b/src/backend/executor/nodeDynamicBitmapIndexscan.c index 7d1494b0cd..d9e43351ad 100644 --- a/src/backend/executor/nodeDynamicBitmapIndexscan.c +++ b/src/backend/executor/nodeDynamicBitmapIndexscan.c @@ -77,6 +77,10 @@ ExecInitDynamicBitmapIndexScan(DynamicBitmapIndexScan *node, EState *estate, int Relation scanRel = ExecOpenScanRelation(estate, node->biscan.scan.scanrelid, eflags); ExecInitScanTupleSlot(estate, &dynamicBitmapIndexScanState->ss, RelationGetDescr(scanRel), table_slot_callbacks(scanRel)); + /* Dynamic table/index/bitmap scan can't tell the ops of tupleslot */ + dynamicBitmapIndexScanState->ss.ps.scanopsfixed = false; + dynamicBitmapIndexScanState->ss.ps.scanopsset = true; + /* * Initialize result tuple type and projection info. */ diff --git a/src/backend/executor/nodeDynamicIndexscan.c b/src/backend/executor/nodeDynamicIndexscan.c index d341404b50..4d7f7ff060 100644 --- a/src/backend/executor/nodeDynamicIndexscan.c +++ b/src/backend/executor/nodeDynamicIndexscan.c @@ -74,6 +74,10 @@ ExecInitDynamicIndexScan(DynamicIndexScan *node, EState *estate, int eflags) Relation scanRel = ExecOpenScanRelation(estate, node->indexscan.scan.scanrelid, eflags); ExecInitScanTupleSlot(estate, &dynamicIndexScanState->ss, RelationGetDescr(scanRel), table_slot_callbacks(scanRel)); + /* Dynamic table/index/bitmap scan can't tell the ops of tupleslot */ + dynamicIndexScanState->ss.ps.scanopsfixed = false; + dynamicIndexScanState->ss.ps.scanopsset = true; + /* * Initialize result tuple type and projection info. */ diff --git a/src/backend/executor/nodeDynamicSeqscan.c b/src/backend/executor/nodeDynamicSeqscan.c index 3e1b367172..657aa5d056 100644 --- a/src/backend/executor/nodeDynamicSeqscan.c +++ b/src/backend/executor/nodeDynamicSeqscan.c @@ -63,10 +63,17 @@ ExecInitDynamicSeqScan(DynamicSeqScan *node, EState *estate, int eflags) Relation scanRel = ExecOpenScanRelation(estate, node->seqscan.scanrelid, eflags); ExecInitScanTupleSlot(estate, &state->ss, RelationGetDescr(scanRel), table_slot_callbacks(scanRel)); + /* Dynamic table/index/bitmap scan can't tell the ops of tupleslot */ + state->ss.ps.scanopsfixed = false; + state->ss.ps.scanopsset = true; + /* Initialize result tuple type. */ ExecInitResultTypeTL(&state->ss.ps); ExecAssignScanProjectionInfo(&state->ss); + state->ss.ps.resultopsfixed = false; + state->ss.ps.resultopsset = true; + state->nOids = list_length(node->partOids); state->partOids = palloc(sizeof(Oid) * state->nOids); foreach_with_count(lc, node->partOids, i) --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
