[HACKERS] identify table oid for an AggState during plan tree initialization

2014-01-15 Thread Masterprojekt Naumann1
Hi, during the initialization of the nodes in the plan tree (in ExecInitNode in the file execProcnode.c) I want to find out for a node with the type T_Agg which table will be aggregated. I tried the following: resultAsAggState = ExecInitAgg((Agg *) node, estate, eflags); if (resultAsAggState) {

Re: [HACKERS] identify table oid for an AggState during plan tree initialization

2014-01-15 Thread Masterprojekt Naumann1
2014/1/15 Masterprojekt Naumann1 mpws201...@gmail.com Hi, during the initialization of the nodes in the plan tree (in ExecInitNode in the file execProcnode.c) I want to find out for a node with the type T_Agg which table will be aggregated. I tried the following: resultAsAggState =

Re: [HACKERS] identify table oid for an AggState during plan tree initialization

2014-01-15 Thread Ashutosh Bapat
Hi Cathleen, An aggregate can be working on more than one table e.g. select count(*) from a, b, c where a.c1 = b.c1 and b.c1 = c.c1; In such a case, which table would you like to be reported? IOW, it doesn't look to be sensible to attach and aggregate with a table. If you can explain what you

Re: [HACKERS] identify table oid for an AggState during plan tree initialization

2014-01-15 Thread Masterprojekt Naumann1
2014/1/15 Ashutosh Bapat ashutosh.ba...@enterprisedb.com Hi Cathleen, An aggregate can be working on more than one table e.g. select count(*) from a, b, c where a.c1 = b.c1 and b.c1 = c.c1; In such a case, which table would you like to be reported? IOW, it doesn't look to be sensible to

Re: [HACKERS] identify table oid for an AggState during plan tree initialization

2014-01-15 Thread Ashutosh Bapat
Hmm, ok, this is slighly involved. Is it important that you should do this at the execution time? At planner level where Agg node is involved, one can look for Aggref node and traverse down the args list to find any vars are involved in aggregation. You can find Var nodes involved in an Aggref by