diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-01-27 20:51:54 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-01-27 20:51:54 +0000 |
commit | 70fba70430bd42b1a31c6d49646f9d1991eb8e7c (patch) | |
tree | 865c11bc1262e1fd48067f9b897abf2a50653ddf /src/backend/utils/adt/selfuncs.c | |
parent | b2773d4099d2dbccc4d23165a093581090c49451 (diff) | |
download | postgresql-70fba70430bd42b1a31c6d49646f9d1991eb8e7c.tar.gz postgresql-70fba70430bd42b1a31c6d49646f9d1991eb8e7c.zip |
Upgrade cost estimation for joins, per discussion with Bradley Baetz.
Try to model the effect of rescanning input tuples in mergejoins;
account for JOIN_IN short-circuiting where appropriate. Also, recognize
that mergejoin and hashjoin clauses may now be more than single operator
calls, so we have to charge appropriate execution costs.
Diffstat (limited to 'src/backend/utils/adt/selfuncs.c')
-rw-r--r-- | src/backend/utils/adt/selfuncs.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index 62e0b8b32a9..8fb4e84ad77 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -15,7 +15,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.129 2003/01/24 03:58:43 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.130 2003/01/27 20:51:54 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -2043,6 +2043,8 @@ estimate_num_groups(Query *root, List *groupExprs, double input_rows) varinfos = newvarinfos; } while (varinfos != NIL); + numdistinct = ceil(numdistinct); + /* Guard against out-of-range answers */ if (numdistinct > input_rows) numdistinct = input_rows; |