diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-07-22 15:41:56 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-07-22 15:41:56 +0000 |
commit | 98359c3e3f9d67c43459f3721106de8eac3352bd (patch) | |
tree | ad8270ae5dc8fa9be7100a50e02631ab2586ef1a /src/backend/optimizer/util/pathnode.c | |
parent | b0dc1fbbc527bec4c26b430f13c032a501a5c72e (diff) | |
download | postgresql-98359c3e3f9d67c43459f3721106de8eac3352bd.tar.gz postgresql-98359c3e3f9d67c43459f3721106de8eac3352bd.zip |
In the recent changes to make the planner account better for cache
effects in a nestloop inner indexscan, I had only dealt with plain index
scans and the index portion of bitmap scans. But there will be cache
benefits for the heap accesses of bitmap scans too, so fix
cost_bitmap_heap_scan() to account for that.
Diffstat (limited to 'src/backend/optimizer/util/pathnode.c')
-rw-r--r-- | src/backend/optimizer/util/pathnode.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/backend/optimizer/util/pathnode.c b/src/backend/optimizer/util/pathnode.c index c58ff88eec1..631d6087d8e 100644 --- a/src/backend/optimizer/util/pathnode.c +++ b/src/backend/optimizer/util/pathnode.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/optimizer/util/pathnode.c,v 1.130 2006/07/14 14:52:21 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/util/pathnode.c,v 1.131 2006/07/22 15:41:55 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -513,14 +513,14 @@ create_index_path(PlannerInfo *root, * * 'bitmapqual' is a tree of IndexPath, BitmapAndPath, and BitmapOrPath nodes. * - * If this is a join inner indexscan path, the component IndexPaths should - * have been costed accordingly, and TRUE should be passed for isjoininner. + * If this is a join inner indexscan path, 'outer_rel' is the outer relation, + * and all the component IndexPaths should have been costed accordingly. */ BitmapHeapPath * create_bitmap_heap_path(PlannerInfo *root, RelOptInfo *rel, Path *bitmapqual, - bool isjoininner) + RelOptInfo *outer_rel) { BitmapHeapPath *pathnode = makeNode(BitmapHeapPath); @@ -529,9 +529,9 @@ create_bitmap_heap_path(PlannerInfo *root, pathnode->path.pathkeys = NIL; /* always unordered */ pathnode->bitmapqual = bitmapqual; - pathnode->isjoininner = isjoininner; + pathnode->isjoininner = (outer_rel != NULL); - if (isjoininner) + if (pathnode->isjoininner) { /* * We must compute the estimated number of output rows for the @@ -560,7 +560,7 @@ create_bitmap_heap_path(PlannerInfo *root, pathnode->rows = rel->rows; } - cost_bitmap_heap_scan(&pathnode->path, root, rel, bitmapqual); + cost_bitmap_heap_scan(&pathnode->path, root, rel, bitmapqual, outer_rel); return pathnode; } |