Hi,

In preprocess_aggref(), list same_input_transnos is used to track compatible 
transnos.

Free it if we don’t need it anymore.

```

/*
 * 2. See if this aggregate can share transition state with another
 * aggregate that we've initialized already.
 */
 transno = find_compatible_trans(root, aggref, shareable,
 aggtransfn, aggtranstype,
 transtypeLen, transtypeByVal,
 aggcombinefn,
 aggserialfn, aggdeserialfn,
 initValue, initValueIsNull,
 same_input_transnos);
 list_free(same_input_transnos);

```

Not sure if it worths as it will be freed sooner or later when current context 
ends.

But as in find_compatible_agg(), the list is freed if we found a compatible Agg.

This patch helps a little when there are lots of incompatible aggs because we 
will try to find the compatible transnos again and again.

Each iteration will keep an unused list memory.

Regards,
Zhang Mingli

Attachment: vn-0001-free-list-same_input_transnos-in-preprocess_aggref.patch
Description: Binary data

Reply via email to