Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitec7629d

Browse files
committed
Teach bitmap heap scan to cope with absence of a DSA.
If we have a plan that uses parallelism but are unable to execute itusing parallelism, for example due to a lack of available DSMsegments, then the EState's es_query_dsa will be NULL. Parallelbitmap heap scan needs to fall back to a non-parallel scan in suchcases.Patch by me, reviewed by Dilip KumarDiscussion:http://postgr.es/m/CAEepm=0kADK5inNf_KuemjX=HQ=PuTP0DykM--fO5jS5ePVFEA@mail.gmail.com
1 parent7015bb3 commitec7629d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

‎src/backend/executor/nodeBitmapHeapscan.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -963,6 +963,11 @@ ExecBitmapHeapInitializeDSM(BitmapHeapScanState *node,
963963
{
964964
ParallelBitmapHeapState*pstate;
965965
EState*estate=node->ss.ps.state;
966+
dsa_area*dsa=node->ss.ps.state->es_query_dsa;
967+
968+
/* If there's no DSA, there are no workers; initialize nothing. */
969+
if (dsa==NULL)
970+
return;
966971

967972
pstate=shm_toc_allocate(pcxt->toc,node->pscan_len);
968973

@@ -995,6 +1000,10 @@ ExecBitmapHeapReInitializeDSM(BitmapHeapScanState *node,
9951000
ParallelBitmapHeapState*pstate=node->pstate;
9961001
dsa_area*dsa=node->ss.ps.state->es_query_dsa;
9971002

1003+
/* If there's no DSA, there are no workers; do nothing. */
1004+
if (dsa==NULL)
1005+
return;
1006+
9981007
pstate->state=BM_INITIAL;
9991008

10001009
if (DsaPointerIsValid(pstate->tbmiterator))
@@ -1019,6 +1028,8 @@ ExecBitmapHeapInitializeWorker(BitmapHeapScanState *node, shm_toc *toc)
10191028
ParallelBitmapHeapState*pstate;
10201029
Snapshotsnapshot;
10211030

1031+
Assert(node->ss.ps.state->es_query_dsa!=NULL);
1032+
10221033
pstate=shm_toc_lookup(toc,node->ss.ps.plan->plan_node_id, false);
10231034
node->pstate=pstate;
10241035

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp