]> granicus.if.org Git - postgresql/commit
Reimplement CASE val WHEN compval1 THEN ... WHEN compval2 THEN ... END
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 17 Mar 2004 20:48:43 +0000 (20:48 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 17 Mar 2004 20:48:43 +0000 (20:48 +0000)
commit55f7c3300d164d370d28b127210223d078da524d
treee5c91b7d50eef3b40dd395e3ecce877bb6663636
parent8c702ea7ace30026dfff4f2e514027cd4d6d7579
Reimplement CASE val WHEN compval1 THEN ... WHEN compval2 THEN ... END
so that the 'val' is computed only once, per recent discussion.  The
speedup is not much when 'val' is just a simple variable, but could be
significant for larger expressions.  More importantly this avoids issues
with multiple evaluations of a volatile 'val', and it allows the CASE
expression to be reverse-listed in its original form by ruleutils.c.
16 files changed:
src/backend/executor/execQual.c
src/backend/executor/execUtils.c
src/backend/nodes/copyfuncs.c
src/backend/nodes/equalfuncs.c
src/backend/nodes/outfuncs.c
src/backend/nodes/readfuncs.c
src/backend/optimizer/util/clauses.c
src/backend/parser/gram.y
src/backend/parser/parse_expr.c
src/backend/utils/adt/ruleutils.c
src/include/catalog/catversion.h
src/include/nodes/execnodes.h
src/include/nodes/nodes.h
src/include/nodes/primnodes.h
src/pl/plpgsql/src/pl_exec.c
src/test/regress/expected/rules.out