From 115a365519bfd53a65bf17d253b26902eff0c337 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 30 Jan 2025 13:21:42 -0500 Subject: Simplify executor's handling of CaseTestExpr & CoerceToDomainValue. Instead of deciding at runtime whether to read from casetest.value or caseValue_datum, split EEOP_CASE_TESTVAL into two opcodes and make the decision during expression compilation. Similarly for EEOP_DOMAIN_TESTVAL. This actually results in net less code, mainly because llvmjit_expr.c's code for handling these opcodes gets shorter. The performance gain is doubtless negligible, but this seems worth changing anyway on grounds of simplicity and understandability. Author: Andreas Karlsson Co-authored-by: Xing Guo Reviewed-by: Tom Lane Discussion: https://postgr.es/m/CACpMh+AiBYAWn+D1aU7Rsy-V1tox06Cbc0H3qA7rwL5zdJ=anQ@mail.gmail.com --- src/include/executor/execExpr.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/include') diff --git a/src/include/executor/execExpr.h b/src/include/executor/execExpr.h index 5371e344ecd..51bd35dcb07 100644 --- a/src/include/executor/execExpr.h +++ b/src/include/executor/execExpr.h @@ -173,6 +173,7 @@ typedef enum ExprEvalOp /* return CaseTestExpr value */ EEOP_CASE_TESTVAL, + EEOP_CASE_TESTVAL_EXT, /* apply MakeExpandedObjectReadOnly() to target value */ EEOP_MAKE_READONLY, @@ -237,6 +238,7 @@ typedef enum ExprEvalOp /* evaluate value for CoerceToDomainValue */ EEOP_DOMAIN_TESTVAL, + EEOP_DOMAIN_TESTVAL_EXT, /* evaluate a domain's NOT NULL constraint */ EEOP_DOMAIN_NOTNULL, -- cgit v1.2.3