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

Commitc6755e2

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 parente42e2f3 commitc6755e2

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
@@ -1051,6 +1051,11 @@ ExecBitmapHeapInitializeDSM(BitmapHeapScanState *node,
10511051
{
10521052
ParallelBitmapHeapState*pstate;
10531053
EState*estate=node->ss.ps.state;
1054+
dsa_area*dsa=node->ss.ps.state->es_query_dsa;
1055+
1056+
/* If there's no DSA, there are no workers; initialize nothing. */
1057+
if (dsa==NULL)
1058+
return;
10541059

10551060
pstate=shm_toc_allocate(pcxt->toc,node->pscan_len);
10561061

@@ -1083,6 +1088,10 @@ ExecBitmapHeapReInitializeDSM(BitmapHeapScanState *node,
10831088
ParallelBitmapHeapState*pstate=node->pstate;
10841089
dsa_area*dsa=node->ss.ps.state->es_query_dsa;
10851090

1091+
/* If there's no DSA, there are no workers; do nothing. */
1092+
if (dsa==NULL)
1093+
return;
1094+
10861095
pstate->state=BM_INITIAL;
10871096

10881097
if (DsaPointerIsValid(pstate->tbmiterator))
@@ -1108,6 +1117,8 @@ ExecBitmapHeapInitializeWorker(BitmapHeapScanState *node,
11081117
ParallelBitmapHeapState*pstate;
11091118
Snapshotsnapshot;
11101119

1120+
Assert(node->ss.ps.state->es_query_dsa!=NULL);
1121+
11111122
pstate=shm_toc_lookup(pwcxt->toc,node->ss.ps.plan->plan_node_id, false);
11121123
node->pstate=pstate;
11131124

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp