diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-01-28 18:50:40 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-01-28 18:50:40 +0000 |
commit | 2b8758a3891414d141c45179e0cb9b32a199b5b5 (patch) | |
tree | 92dbe270eed7fd979450669ad8bb40cd511ea91a /src | |
parent | 5681cde7b1837fbaf6f6d6c98f44799755e5f634 (diff) | |
download | postgresql-2b8758a3891414d141c45179e0cb9b32a199b5b5.tar.gz postgresql-2b8758a3891414d141c45179e0cb9b32a199b5b5.zip |
Repair oversight in creation of "append relations": we should set up
rel->tuples as well as rel->rows, since some estimation functions expect both
to be valid in every baserel. Per report from Dave Dutcher.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/optimizer/path/allpaths.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c index cbe78c3abd5..43891a18459 100644 --- a/src/backend/optimizer/path/allpaths.c +++ b/src/backend/optimizer/path/allpaths.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/optimizer/path/allpaths.c,v 1.157 2007/01/20 20:45:38 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/path/allpaths.c,v 1.158 2007/01/28 18:50:40 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -394,6 +394,12 @@ set_append_rel_pathlist(PlannerInfo *root, RelOptInfo *rel, } /* + * Set "raw tuples" count equal to "rows" for the appendrel; needed + * because some places assume rel->tuples is valid for any baserel. + */ + rel->tuples = rel->rows; + + /* * Finally, build Append path and install it as the only access path for * the parent rel. (Note: this is correct even if we have zero or one * live subpath due to constraint exclusion.) |