cache type info in json_agg and friends

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема cache type info in json_agg and friends
Дата
Msg-id 55F71E7B.5020104@dunslane.net
обсуждение исходный текст
Ответы Re: cache type info in json_agg and friends  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Re: cache type info in json_agg and friends  (Teodor Sigaev <teodor@sigaev.ru>)
Список pgsql-hackers
Currently, json_agg, jsonb_agg, json_object_agg and jsonb_object_agg do
type classification on their arguments on each call to the transition
function. This is quite unnecessary, as the argument types won't change.
This patch remedies the defect by caching the necessary values in the
aggregate state object.

While this doesn't change the performance much, since these functions
are essentially dominated by other bits of the processing, I think it is
nevertheless worth doing.

There are other areas where we might attack this, also. In particular,
if one of the arguments is a record, then composite_to_json(b) will do
this for every attribute of every record. However, it's much less clear
to me how we can cache this information sensibly.

cheers

andrew

Вложения

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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: jsonb_set array append hack?
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: cache type info in json_agg and friends