diff options
author | Andres Freund <andres@anarazel.de> | 2019-09-30 16:06:16 -0700 |
---|---|---|
committer | Andres Freund <andres@anarazel.de> | 2019-09-30 16:06:16 -0700 |
commit | 36d22dd95bc87ca68e742da91f47f8826f8758c9 (patch) | |
tree | bfc8ce87848e25ded000f0f164e0e210bd8e9c6c /src/backend/jit/llvm/llvmjit_expr.c | |
parent | 34c9c53bb035ba92491006eb80f7a60527db367d (diff) | |
download | postgresql-36d22dd95bc87ca68e742da91f47f8826f8758c9.tar.gz postgresql-36d22dd95bc87ca68e742da91f47f8826f8758c9.zip |
Don't generate EEOP_*_FETCHSOME operations for slots know to be virtual.
That avoids unnecessary work during both interpreted execution, and
JIT compiled expression evaluation. Both benefit from fewer expression
steps needing be processed, and for interpreted execution there now is
a fastpath dedicated to just fetching a value from a virtual
slot. That's e.g. beneficial for hashjoins over nodes that perform
projections, as the hashed columns are currently fetched individually.
Author: Soumyadeep Chakraborty, Andres Freund
Discussion: https://postgr.es/m/CAE-ML+9OKSN71+mHtfMD-L24oDp8dGTfaVjDU6U+j+FNAW5kRQ@mail.gmail.com
Diffstat (limited to 'src/backend/jit/llvm/llvmjit_expr.c')
-rw-r--r-- | src/backend/jit/llvm/llvmjit_expr.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/jit/llvm/llvmjit_expr.c b/src/backend/jit/llvm/llvmjit_expr.c index 30133634c70..d09324637b9 100644 --- a/src/backend/jit/llvm/llvmjit_expr.c +++ b/src/backend/jit/llvm/llvmjit_expr.c @@ -287,6 +287,9 @@ llvm_compile_expr(ExprState *state) if (op->d.fetch.fixed) tts_ops = op->d.fetch.kind; + /* step should not have been generated */ + Assert(tts_ops != &TTSOpsVirtual); + if (opcode == EEOP_INNER_FETCHSOME) v_slot = v_innerslot; else if (opcode == EEOP_OUTER_FETCHSOME) @@ -297,9 +300,6 @@ llvm_compile_expr(ExprState *state) /* * Check if all required attributes are available, or * whether deforming is required. - * - * TODO: skip nvalid check if slot is fixed and known to - * be a virtual slot. */ v_nvalid = l_load_struct_gep(b, v_slot, |