mirror of
https://github.com/postgres/postgres.git
synced 2025-11-06 07:49:08 +03:00
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.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/nodes/nodes.h,v 1.150 2004/01/07 18:43:36 neilc Exp $
|
||||
* $PostgreSQL: pgsql/src/include/nodes/nodes.h,v 1.151 2004/03/17 20:48:43 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -113,6 +113,7 @@ typedef enum NodeTag
|
||||
T_RelabelType,
|
||||
T_CaseExpr,
|
||||
T_CaseWhen,
|
||||
T_CaseTestExpr,
|
||||
T_ArrayExpr,
|
||||
T_CoalesceExpr,
|
||||
T_NullIfExpr,
|
||||
|
||||
Reference in New Issue
Block a user