mirror of
https://github.com/postgres/postgres.git
synced 2025-06-27 23:21:58 +03:00
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
This commit is contained in:
@ -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,
|
||||
|
Reference in New Issue
Block a user