Don't deform column-by-column in composite_to_json

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Don't deform column-by-column in composite_to_json
Дата
Msg-id 20190201232116.6zil5sqmdxg4ndm4@alap3.anarazel.de
обсуждение исходный текст
Ответы Re: Don't deform column-by-column in composite_to_json  (Daniel Gustafsson <daniel@yesql.se>)
Re: Don't deform column-by-column in composite_to_json  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
Hi,

In https://postgr.es/m/20190201162404.onngi77f26baem4g%40alap3.anarazel.de
I noticed that composite_to_json() deforms column-by-column. Given that
it always processes all columns, that seems quite the waste of resources.

In some quick'n dirty dirty testing this gives a ~4% benefit in a table
without nulls and varlenas, and ~7% in one with both. I assume that if
one were to test with a bit wider table the win would be bigger.

A short test shows that it'd be slower to allocate nulls/values with
palloc rather than using MaxHeapAttributeNumber. Given that only output
functions are called from within composite_to_json(), I think that's ok.

Greetings,

Andres Freund

Вложения

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

Предыдущее
От: Chengchao Yu
Дата:
Сообщение: RE: [PATCH] Fix Proposal - Deadlock Issue in Single User Mode When IOFailure Occurs
Следующее
От: Thomas Munro
Дата:
Сообщение: Re: DNS SRV support for LDAP authentication