Content-Length: 303301 | pFad | http://github.com/postgrespro/postgres/commit/c6755e233be1cccadd0884d952a2bb455fa0db1f

40 Teach bitmap heap scan to cope with absence of a DSA. · postgrespro/postgres@c6755e2 · GitHub
Skip to content

Commit c6755e2

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 it using parallelism, for example due to a lack of available DSM segments, then the EState's es_query_dsa will be NULL. Parallel bitmap heap scan needs to fall back to a non-parallel scan in such cases. Patch by me, reviewed by Dilip Kumar Discussion: http://postgr.es/m/CAEepm=0kADK5inNf_KuemjX=HQ=PuTP0DykM--fO5jS5ePVFEA@mail.gmail.com
1 parent e42e2f3 commit c6755e2

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
Snapshot snapshot;
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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/c6755e233be1cccadd0884d952a2bb455fa0db1f

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy