diff options
Diffstat (limited to 'src/backend/optimizer')
-rw-r--r-- | src/backend/optimizer/path/costsize.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/backend/optimizer/path/costsize.c b/src/backend/optimizer/path/costsize.c index d6ceafd51c5..5227346aeb1 100644 --- a/src/backend/optimizer/path/costsize.c +++ b/src/backend/optimizer/path/costsize.c @@ -6393,12 +6393,20 @@ get_parallel_divisor(Path *path) /* * compute_bitmap_pages + * Estimate number of pages fetched from heap in a bitmap heap scan. * - * compute number of pages fetched from heap in bitmap heap scan. + * 'baserel' is the relation to be scanned + * 'bitmapqual' is a tree of IndexPaths, BitmapAndPaths, and BitmapOrPaths + * 'loop_count' is the number of repetitions of the indexscan to factor into + * estimates of caching behavior + * + * If cost_p isn't NULL, the indexTotalCost estimate is returned in *cost_p. + * If tuples_p isn't NULL, the tuples_fetched estimate is returned in *tuples_p. */ double -compute_bitmap_pages(PlannerInfo *root, RelOptInfo *baserel, Path *bitmapqual, - int loop_count, Cost *cost, double *tuple) +compute_bitmap_pages(PlannerInfo *root, RelOptInfo *baserel, + Path *bitmapqual, double loop_count, + Cost *cost_p, double *tuples_p) { Cost indexTotalCost; Selectivity indexSelectivity; @@ -6488,10 +6496,10 @@ compute_bitmap_pages(PlannerInfo *root, RelOptInfo *baserel, Path *bitmapqual, (lossy_pages / heap_pages) * baserel->tuples); } - if (cost) - *cost = indexTotalCost; - if (tuple) - *tuple = tuples_fetched; + if (cost_p) + *cost_p = indexTotalCost; + if (tuples_p) + *tuples_p = tuples_fetched; return pages_fetched; } |