pgsql: Cache argument type information in json(b) aggregate functions.

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема pgsql: Cache argument type information in json(b) aggregate functions.
Дата
Msg-id E1Zd0fT-0006BT-9K@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Cache argument type information in json(b) aggregate functions.

These functions have been looking up type info for every row they
process. Instead of doing that we only look them up the first time
through and stash the information in the aggregate state object.

Affects json_agg, json_object_agg, jsonb_agg and jsonb_object_agg.

There is plenty more work to do in making these more efficient,
especially the jsonb functions, but this is a virtually cost free
improvement that can be done right away.

Backpatch to 9.5 where the jsonb variants were introduced.

Branch
------
REL9_5_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/1e1ae6e0b0c11e6044c0dacd61cb17c8d8bc87f1

Modified Files
--------------
src/backend/utils/adt/json.c  |  125 ++++++++++++++++------------
src/backend/utils/adt/jsonb.c |  181 ++++++++++++++++++++++-------------------
2 files changed, 173 insertions(+), 133 deletions(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix low-probability memory leak in regex execution.
Следующее
От: Andrew Dunstan
Дата:
Сообщение: pgsql: Cache argument type information in json(b) aggregate functions.