Обсуждение: pgsql: Pass collation to makeConst() instead of looking it up internall

Поиск
Список
Период
Сортировка

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

От
Tom Lane
Дата:
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(-)