mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +03:00
Move per-agg and per-trans duplicate finding to the planner.
This has the advantage that the cost estimates for aggregates can count the number of calls to transition and final functions correctly. Bump catalog version, because views can contain Aggrefs. Reviewed-by: Andres Freund Discussion: https://www.postgresql.org/message-id/b2e3536b-1dbc-8303-c97e-89cb0b4a9a48%40iki.fi
This commit is contained in:
contrib/postgres_fdw
src
backend
executor
jit
llvm
nodes
optimizer
parser
utils
adt
include
catalog
executor
nodes
optimizer
utils
test
regress
tools
pgindent
@ -1849,20 +1849,11 @@ llvm_compile_expr(ExprState *state)
|
||||
|
||||
case EEOP_AGGREF:
|
||||
{
|
||||
AggrefExprState *aggref = op->d.aggref.astate;
|
||||
LLVMValueRef v_aggnop;
|
||||
LLVMValueRef v_aggno;
|
||||
LLVMValueRef value,
|
||||
isnull;
|
||||
|
||||
/*
|
||||
* At this point aggref->aggno is not yet set (it's set up
|
||||
* in ExecInitAgg() after initializing the expression). So
|
||||
* load it from memory each time round.
|
||||
*/
|
||||
v_aggnop = l_ptr_const(&aggref->aggno,
|
||||
l_ptr(LLVMInt32Type()));
|
||||
v_aggno = LLVMBuildLoad(b, v_aggnop, "v_aggno");
|
||||
v_aggno = l_int32_const(op->d.aggref.aggno);
|
||||
|
||||
/* load agg value / null */
|
||||
value = l_load_gep1(b, v_aggvalues, v_aggno, "aggvalue");
|
||||
|
Reference in New Issue
Block a user