1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-26 01:22:12 +03:00

Don't generate tuple deforming functions for virtual slots.

Virtual tuple table slots never need tuple deforming. Therefore, if we
know at expression compilation time, that a certain slot will always
be virtual, there's no need to create a tuple deforming routine for
it.

Author: Andres Freund
Discussion: https://postgr.es/m/20181105210039.hh4vvi4vwoq5ba2q@alap3.anarazel.de
This commit is contained in:
Andres Freund
2018-11-15 22:00:30 -08:00
parent 15d8f83128
commit 7ef04e4d2c
3 changed files with 10 additions and 2 deletions
src

@ -31,7 +31,8 @@
* Create a function that deforms a tuple of type desc up to natts columns.
*/
LLVMValueRef
slot_compile_deform(LLVMJitContext *context, TupleDesc desc, int natts)
slot_compile_deform(LLVMJitContext *context, TupleDesc desc,
const TupleTableSlotOps *ops, int natts)
{
char *funcname;
@ -88,6 +89,10 @@ slot_compile_deform(LLVMJitContext *context, TupleDesc desc, int natts)
int attnum;
/* virtual tuples never need deforming, so don't generate code */
if (ops == &TTSOpsVirtual)
return NULL;
mod = llvm_mutable_module(context);
funcname = llvm_expand_funcname(context, "deform");