mirror of
https://github.com/postgres/postgres.git
synced 2025-07-05 07:21:24 +03:00
Support parallel bitmap heap scans.
The index is scanned by a single process, but then all cooperating processes can iterate jointly over the resulting set of heap blocks. In the future, we might also want to support using a parallel bitmap index scan to set up for a parallel bitmap heap scan, but that's a job for another day. Dilip Kumar, with some corrections and cosmetic changes by me. The larger patch set of which this is a part has been reviewed and tested by (at least) Andres Freund, Amit Khandekar, Tushar Ahuja, Rafia Sabih, Haribabu Kommi, Thomas Munro, and me. Discussion: http://postgr.es/m/CAFiTN-uc4=0WxRGfCzs-xfkMYcSEWUC-Fon6thkJGjkh9i=13A@mail.gmail.com
This commit is contained in:
@ -1068,7 +1068,8 @@ create_bitmap_heap_path(PlannerInfo *root,
|
||||
RelOptInfo *rel,
|
||||
Path *bitmapqual,
|
||||
Relids required_outer,
|
||||
double loop_count)
|
||||
double loop_count,
|
||||
int parallel_degree)
|
||||
{
|
||||
BitmapHeapPath *pathnode = makeNode(BitmapHeapPath);
|
||||
|
||||
@ -1077,9 +1078,9 @@ create_bitmap_heap_path(PlannerInfo *root,
|
||||
pathnode->path.pathtarget = rel->reltarget;
|
||||
pathnode->path.param_info = get_baserel_parampathinfo(root, rel,
|
||||
required_outer);
|
||||
pathnode->path.parallel_aware = false;
|
||||
pathnode->path.parallel_aware = parallel_degree > 0 ? true : false;
|
||||
pathnode->path.parallel_safe = rel->consider_parallel;
|
||||
pathnode->path.parallel_workers = 0;
|
||||
pathnode->path.parallel_workers = parallel_degree;
|
||||
pathnode->path.pathkeys = NIL; /* always unordered */
|
||||
|
||||
pathnode->bitmapqual = bitmapqual;
|
||||
@ -3281,7 +3282,7 @@ reparameterize_path(PlannerInfo *root, Path *path,
|
||||
rel,
|
||||
bpath->bitmapqual,
|
||||
required_outer,
|
||||
loop_count);
|
||||
loop_count, 0);
|
||||
}
|
||||
case T_SubqueryScan:
|
||||
{
|
||||
|
Reference in New Issue
Block a user