Free list same_input_transnos in preprocess_aggref

Поиск
Список
Период
Сортировка
От Zhang Mingli
Тема Free list same_input_transnos in preprocess_aggref
Дата
Msg-id c9e2b422-db98-4277-bde0-03cc9e96f77b@Spark
обсуждение исходный текст
Ответы Re: Free list same_input_transnos in preprocess_aggref  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
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
Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: remove more archiving overhead
Следующее
От: "a.rybakina"
Дата:
Сообщение: Re: RFC: Logging plan of the running query