Simplify executor's handling of CaseTestExpr & CoerceToDomainValue.
Tom Lane <tgl@sss.pgh.pa.us>
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 <andreas@proxel.se> Co-authored-by: Xing Guo <higuoxing@gmail.com> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CACpMh+AiBYAWn+D1aU7Rsy-V1tox06Cbc0H3qA7rwL5zdJ=anQ@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/executor/execExpr.c | modified | +21 −13 |
| src/backend/executor/execExprInterp.c | modified | +24 −35 |
| src/backend/jit/llvm/llvmjit_expr.c | modified | +16 −40 |
| src/include/executor/execExpr.h | modified | +2 −0 |
Discussion
- JIT: The nullness of casetest.value can be determined at the JIT compile time. 6 messages · 2024-08-31 → 2025-01-30