Add special case fast-paths for strict functions
authorDaniel Gustafsson <dgustafsson@postgresql.org>
Tue, 11 Mar 2025 11:02:42 +0000 (12:02 +0100)
committerDaniel Gustafsson <dgustafsson@postgresql.org>
Tue, 11 Mar 2025 11:02:42 +0000 (12:02 +0100)
commitd35d32d7112bc632c6a305e9dffdec0082bbdf00
tree0e8b4c3c6b8603977cc68e59bc372764e7b489d8
parent8dd7c7cd0a2605d5301266a6b67a569d6a305106
Add special case fast-paths for strict functions

Many STRICT function calls will have one or two arguments, in which
case we can speed up checking for NULL input by avoiding setting up
a loop over the arguments. This adds EEOP_FUNCEXPR_STRICT_1 and the
corresponding EEOP_FUNCEXPR_STRICT_2 for functions with one and two
arguments respectively.

Author: Andres Freund <andres@anarazel.de>
Co-authored-by: Daniel Gustafsson <daniel@yesql.se>
Reviewed-by: Andreas Karlsson <andreas@proxel.se>
Discussion: https://postgr.es/m/415721CE-7D2E-4B74-B5D9-1950083BA03E@yesql.se
Discussion: https://postgr.es/m/20191023163849.sosqbfs5yenocez3@alap3.anarazel.de
src/backend/executor/execExpr.c
src/backend/executor/execExprInterp.c
src/backend/jit/llvm/llvmjit_expr.c
src/include/executor/execExpr.h