diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-04-06 16:34:07 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-04-06 16:34:07 +0000 |
commit | ad161bcc8a3792d18ef2f3ebe66bb1e22d42b6f2 (patch) | |
tree | 18ec8963fbd1d6dd62ad214bfe3552fc2e7d06eb /src/backend/optimizer/util/clauses.c | |
parent | 0f3748a28c42d09d794ff00af3f1f992eaa5fd7c (diff) |
Merge Resdom nodes into TargetEntry nodes to simplify code and save a
few palloc's. I also chose to eliminate the restype and restypmod fields
entirely, since they are redundant with information stored in the node's
contained expression; re-examining the expression at need seems simpler
and more reliable than trying to keep restype/restypmod up to date.
initdb forced due to change in contents of stored rules.
Diffstat (limited to 'src/backend/optimizer/util/clauses.c')
-rw-r--r-- | src/backend/optimizer/util/clauses.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/backend/optimizer/util/clauses.c b/src/backend/optimizer/util/clauses.c index 2cf4fcd663d..24d74523c37 100644 --- a/src/backend/optimizer/util/clauses.c +++ b/src/backend/optimizer/util/clauses.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/optimizer/util/clauses.c,v 1.192 2005/03/31 22:46:09 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/util/clauses.c,v 1.193 2005/04/06 16:34:06 tgl Exp $ * * HISTORY * AUTHOR DATE MAJOR EVENT @@ -966,22 +966,22 @@ has_distinct_on_clause(Query *query) { TargetEntry *tle = (TargetEntry *) lfirst(l); - if (tle->resdom->ressortgroupref == 0) + if (tle->ressortgroupref == 0) { - if (tle->resdom->resjunk) + if (tle->resjunk) continue; /* we can ignore unsorted junk cols */ return true; /* definitely not in DISTINCT list */ } if (targetIsInSortList(tle, query->distinctClause)) { - if (tle->resdom->resjunk) + if (tle->resjunk) return true; /* junk TLE in DISTINCT means DISTINCT ON */ /* else this TLE is okay, keep looking */ } else { /* This TLE is not in DISTINCT list */ - if (!tle->resdom->resjunk) + if (!tle->resjunk) return true; /* non-junk, non-DISTINCT, so DISTINCT ON */ if (targetIsInSortList(tle, query->sortClause)) return true; /* sorted, non-distinct junk */ @@ -3314,10 +3314,6 @@ expression_tree_mutator(Node *node, break; case T_TargetEntry: { - /* - * We mutate the expression, but not the resdom, by - * default. - */ TargetEntry *targetentry = (TargetEntry *) node; TargetEntry *newnode; |