diff options
| author | Daniel Gustafsson <dgustafsson@postgresql.org> | 2025-03-11 12:02:38 +0100 |
|---|---|---|
| committer | Daniel Gustafsson <dgustafsson@postgresql.org> | 2025-03-11 12:02:38 +0100 |
| commit | 8dd7c7cd0a2605d5301266a6b67a569d6a305106 (patch) | |
| tree | 1da627dcaf9c5f7cc30de84292b2463858de8f58 /src/backend/executor/README | |
| parent | dabccf45139a8c7c3c2e7683a943c31077e55a78 (diff) | |
Replace EEOP_DONE with special steps for return/no return
Knowing when the side-effects of an expression is the intended result
of the execution, rather than the returnvalue, is important for being
able generate more efficient JITed code. This replaces EEOP_DONE with
two new steps: EEOP_DONE_RETURN and EEOP_DONE_NO_RETURN. Expressions
which return a value should use the former step; expressions used for
their side-effects which don't return value should use the latter.
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
Diffstat (limited to 'src/backend/executor/README')
| -rw-r--r-- | src/backend/executor/README | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/backend/executor/README b/src/backend/executor/README index 1db9642be85..02745c23ed9 100644 --- a/src/backend/executor/README +++ b/src/backend/executor/README @@ -133,9 +133,14 @@ is used by the function evaluation step, thus avoiding extra work to copy the result values around. The last entry in a completed ExprState->steps array is always an -EEOP_DONE step; this removes the need to test for end-of-array while -iterating. Also, if the expression contains any variable references (to -user columns of the ExprContext's INNER, OUTER, or SCAN tuples), the steps +EEOP_DONE_RETURN or EEOP_DONE_NO_RETURN step; this removes the need to +test for end-of-array while iterating. The former is used when the +expression returns a value directly, the latter when side-effects of +expression initialization are the goal (e.g. for projection or +aggregate transition value computation). + +Also, if the expression contains any variable references (to user +columns of the ExprContext's INNER, OUTER, or SCAN tuples), the steps array begins with EEOP_*_FETCHSOME steps that ensure that the relevant tuples have been deconstructed to make the required columns directly available (cf. slot_getsomeattrs()). This allows individual Var-fetching |
