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

Commitf35742c

Browse files
committed
Support parallel bitmap heap scans.
The index is scanned by a single process, but then all cooperatingprocesses can iterate jointly over the resulting set of heap blocks.In the future, we might also want to support using a parallel bitmapindex scan to set up for a parallel bitmap heap scan, but that's ajob for another day.Dilip Kumar, with some corrections and cosmetic changes by me. Thelarger patch set of which this is a part has been reviewed and testedby (at least) Andres Freund, Amit Khandekar, Tushar Ahuja, RafiaSabih, Haribabu Kommi, Thomas Munro, and me.Discussion:http://postgr.es/m/CAFiTN-uc4=0WxRGfCzs-xfkMYcSEWUC-Fon6thkJGjkh9i=13A@mail.gmail.com
1 parent4eafdcc commitf35742c

File tree

24 files changed

+612
-55
lines changed

24 files changed

+612
-55
lines changed

‎doc/src/sgml/monitoring.sgml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1211,7 +1211,7 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
12111211
<entry>Waiting in an extension.</entry>
12121212
</row>
12131213
<row>
1214-
<entry morerows="10"><literal>IPC</></entry>
1214+
<entry morerows="11"><literal>IPC</></entry>
12151215
<entry><literal>BgWorkerShutdown</></entry>
12161216
<entry>Waiting for background worker to shut down.</entry>
12171217
</row>
@@ -1247,6 +1247,10 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
12471247
<entry><literal>ParallelFinish</></entry>
12481248
<entry>Waiting for parallel workers to finish computing.</entry>
12491249
</row>
1250+
<row>
1251+
<entry><literal>ParallelBitmapPopulate</></entry>
1252+
<entry>Waiting for the leader to populate the TidBitmap.</entry>
1253+
</row>
12501254
<row>
12511255
<entry><literal>SafeSnapshot</></entry>
12521256
<entry>Waiting for a snapshot for a <literal>READ ONLY DEFERRABLE</> transaction.</entry>

‎src/backend/access/heap/heapam.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1753,6 +1753,22 @@ heap_parallelscan_nextpage(HeapScanDesc scan)
17531753
returnpage;
17541754
}
17551755

1756+
/* ----------------
1757+
*heap_update_snapshot
1758+
*
1759+
*Update snapshot info in heap scan descriptor.
1760+
* ----------------
1761+
*/
1762+
void
1763+
heap_update_snapshot(HeapScanDescscan,Snapshotsnapshot)
1764+
{
1765+
Assert(IsMVCCSnapshot(snapshot));
1766+
1767+
RegisterSnapshot(snapshot);
1768+
scan->rs_snapshot=snapshot;
1769+
scan->rs_temp_snap= true;
1770+
}
1771+
17561772
/* ----------------
17571773
*heap_getnext- retrieve next tuple in scan
17581774
*

‎src/backend/executor/execParallel.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
#include"executor/execParallel.h"
2727
#include"executor/executor.h"
28+
#include"executor/nodeBitmapHeapscan.h"
2829
#include"executor/nodeCustom.h"
2930
#include"executor/nodeForeignscan.h"
3031
#include"executor/nodeSeqscan.h"
@@ -217,6 +218,10 @@ ExecParallelEstimate(PlanState *planstate, ExecParallelEstimateContext *e)
217218
ExecCustomScanEstimate((CustomScanState*)planstate,
218219
e->pcxt);
219220
break;
221+
caseT_BitmapHeapScanState:
222+
ExecBitmapHeapEstimate((BitmapHeapScanState*)planstate,
223+
e->pcxt);
224+
break;
220225
default:
221226
break;
222227
}
@@ -277,6 +282,11 @@ ExecParallelInitializeDSM(PlanState *planstate,
277282
ExecCustomScanInitializeDSM((CustomScanState*)planstate,
278283
d->pcxt);
279284
break;
285+
caseT_BitmapHeapScanState:
286+
ExecBitmapHeapInitializeDSM((BitmapHeapScanState*)planstate,
287+
d->pcxt);
288+
break;
289+
280290
default:
281291
break;
282292
}
@@ -775,6 +785,10 @@ ExecParallelInitializeWorker(PlanState *planstate, shm_toc *toc)
775785
ExecCustomScanInitializeWorker((CustomScanState*)planstate,
776786
toc);
777787
break;
788+
caseT_BitmapHeapScanState:
789+
ExecBitmapHeapInitializeWorker(
790+
(BitmapHeapScanState*)planstate,toc);
791+
break;
778792
default:
779793
break;
780794
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp