pgsql: Pass collation to makeConst() instead of looking it up internall

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Pass collation to makeConst() instead of looking it up internall
Date: 2011-03-26 00:10:52
Message-ID: E1Q3H5g-0007rg-H7@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Pass collation to makeConst() instead of looking it up internally.

In nearly all cases, the caller already knows the correct collation, and
in a number of places, the value the caller has handy is more correct than
the default for the type would be. (In particular, this patch makes it
significantly less likely that eval_const_expressions will result in
changing the exposed collation of an expression.) So an internal lookup
is both expensive and wrong.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/bfa4440ca5d948c4d4f0ab5bb82d433200c35288

Modified Files
--------------
src/backend/commands/tablecmds.c | 4 +-
src/backend/executor/execQual.c | 2 +-
src/backend/executor/functions.c | 2 +
src/backend/nodes/makefuncs.c | 8 ++-
src/backend/optimizer/path/indxpath.c | 43 ++++++++++++++--
src/backend/optimizer/plan/planagg.c | 3 +-
src/backend/optimizer/prep/preptlist.c | 3 +
src/backend/optimizer/prep/prepunion.c | 1 +
src/backend/optimizer/util/clauses.c | 90 +++++++++++++++++++-------------
src/backend/parser/parse_coerce.c | 5 ++-
src/backend/parser/parse_node.c | 3 +
src/backend/parser/parse_relation.c | 3 +-
src/backend/parser/parse_target.c | 3 +-
src/backend/rewrite/rewriteHandler.c | 4 +-
src/backend/rewrite/rewriteManip.c | 3 +-
src/backend/utils/adt/selfuncs.c | 40 +++++++++++++-
src/backend/utils/cache/lsyscache.c | 1 +
src/include/nodes/makefuncs.h | 3 +-
18 files changed, 165 insertions(+), 56 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Simon Riggs 2011-03-26 10:15:27 pgsql: Additional test for each commit in sync rep path to plug minute
Previous Message Tom Lane 2011-03-25 22:45:00 pgsql: Fix failure to propagate collation in negate_clause().