aboutsummaryrefslogtreecommitdiff
path: root/src/backend/nodes/outfuncs.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-05-22 01:40:42 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-05-22 01:40:42 +0000
commit107cbb2b9011e7179427aa67b35a97b49d572f6c (patch)
tree95709ca1fac67db588e3093d61bc647a4b4ce4b2 /src/backend/nodes/outfuncs.c
parent06df9a69e83396da87083bf5810855547b3ffff4 (diff)
downloadpostgresql-107cbb2b9011e7179427aa67b35a97b49d572f6c.tar.gz
postgresql-107cbb2b9011e7179427aa67b35a97b49d572f6c.zip
Fix best_inner_indexscan to return both the cheapest-total-cost and
cheapest-startup-cost innerjoin indexscans, and make joinpath.c consider both of these (when different) as the inside of a nestloop join. The original design was based on the assumption that indexscan paths always have negligible startup cost, and so total cost is the only important figure of merit; an assumption that's obviously broken by bitmap indexscans. This oversight could lead to choosing poor plans in cases where fast-start behavior is more important than total cost, such as LIMIT and IN queries. 8.1-vintage brain fade exposed by an example from Chuck D.
Diffstat (limited to 'src/backend/nodes/outfuncs.c')
-rw-r--r--src/backend/nodes/outfuncs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c
index cbffa3a3a47..fdcc2cdc5f6 100644
--- a/src/backend/nodes/outfuncs.c
+++ b/src/backend/nodes/outfuncs.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.285 2006/09/19 22:49:52 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.285.2.1 2007/05/22 01:40:42 tgl Exp $
*
* NOTES
* Every node type that can appear in stored rules' parsetrees *must*
@@ -1280,7 +1280,8 @@ _outInnerIndexscanInfo(StringInfo str, InnerIndexscanInfo *node)
WRITE_NODE_TYPE("INNERINDEXSCANINFO");
WRITE_BITMAPSET_FIELD(other_relids);
WRITE_BOOL_FIELD(isouterjoin);
- WRITE_NODE_FIELD(best_innerpath);
+ WRITE_NODE_FIELD(cheapest_startup_innerpath);
+ WRITE_NODE_FIELD(cheapest_total_innerpath);
}
static void