|
31 | 31 | #include "utils/syscache.h"
|
32 | 32 | #include "optimizer/clauses.h"
|
33 | 33 |
|
34 |
| -#ifdef FREE_TUPLE_MEMORY |
35 |
| -#include <utils/portal.h> |
36 |
| -#include <utils/trace.h> |
37 |
| -#endif |
38 |
| - |
39 | 34 | /*
|
40 | 35 | * AggFuncInfo -
|
41 | 36 | * keeps the transition functions information around
|
@@ -118,9 +113,7 @@ ExecAgg(Agg *node)
|
118 | 113 | isNull1 = FALSE,
|
119 | 114 | isNull2 = FALSE;
|
120 | 115 | bool qual_result;
|
121 |
| -#ifdef FREE_TUPLE_MEMORY |
122 |
| - bool free_tuple_memory = pg_options[OPT_FREE_TUPLE_MEMORY]; |
123 |
| -#endif |
| 116 | + |
124 | 117 |
|
125 | 118 | /* ---------------------
|
126 | 119 | * get state info from node
|
@@ -248,10 +241,6 @@ ExecAgg(Agg *node)
|
248 | 241 | for (;;)
|
249 | 242 | {
|
250 | 243 | TupleTableSlot *outerslot;
|
251 |
| -#ifdef FREE_TUPLE_MEMORY |
252 |
| - Oid valueType; |
253 |
| - bool isByValue = 0; |
254 |
| -#endif |
255 | 244 |
|
256 | 245 | isNull = isNull1 = isNull2 = 0;
|
257 | 246 | outerslot = ExecProcNode(outerPlan, (Plan *) node);
|
@@ -304,31 +293,6 @@ ExecAgg(Agg *node)
|
304 | 293 | newVal = ExecEvalExpr(aggref->target, econtext,
|
305 | 294 | &isNull, &isDone);
|
306 | 295 | }
|
307 |
| -#ifdef FREE_TUPLE_MEMORY |
308 |
| - if (free_tuple_memory) { |
309 |
| - switch (nodeTag(aggref->target)) { |
310 |
| - case T_Const: |
311 |
| - isByValue = ((Const*) (aggref->target))->constbyval; |
312 |
| - break; |
313 |
| - case T_Var: |
314 |
| - valueType = ((Var*) (aggref->target))->vartype; |
315 |
| - isByValue = typeByVal(typeidType(valueType)); |
316 |
| - break; |
317 |
| - case T_Array: |
318 |
| - isByValue = ((Array*)(aggref->target))->arrayelembyval; |
319 |
| - break; |
320 |
| - case T_ArrayRef: |
321 |
| - isByValue =((ArrayRef*)(aggref->target))->refelembyval; |
322 |
| - break; |
323 |
| - case T_Expr: |
324 |
| - valueType = ((Expr*) (aggref->target))->typeOid; |
325 |
| - isByValue = typeByVal(typeidType(valueType)); |
326 |
| - break; |
327 |
| - default: |
328 |
| - break; |
329 |
| - } |
330 |
| - } |
331 |
| -#endif |
332 | 296 |
|
333 | 297 | if (isNull && !aggref->usenulls)
|
334 | 298 | continue; /* ignore this tuple for this agg */
|
@@ -389,16 +353,6 @@ ExecAgg(Agg *node)
|
389 | 353 | (FmgrValues *) args, &isNull2);
|
390 | 354 | Assert(!isNull2);
|
391 | 355 | }
|
392 |
| - |
393 |
| -#ifdef FREE_TUPLE_MEMORY |
394 |
| - /* try to pfree newVal if not isByValue - dz */ |
395 |
| - if (free_tuple_memory && !isByValue && |
396 |
| - PortalHeapMemoryIsValid(CurrentMemoryContext, |
397 |
| - (Pointer) newVal)) |
398 |
| - { |
399 |
| - pfree(newVal); |
400 |
| - } |
401 |
| -#endif |
402 | 356 | }
|
403 | 357 |
|
404 | 358 | /*
|
|
0 commit comments