Re: libpq: PQfnumber overload for not null-terminated strings

Поиск
Список
Период
Сортировка
От Jelte Fennema-Nio
Тема Re: libpq: PQfnumber overload for not null-terminated strings
Дата
Msg-id CAGECzQQ_cEU+8VtHOMe=fCPaS6q5YW+8-ThmAFf3hpTH5s_+wQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: libpq: PQfnumber overload for not null-terminated strings  (Ivan Trofimov <i.trofimow@yandex.ru>)
Ответы Re: libpq: PQfnumber overload for not null-terminated strings  (Ivan Trofimov <i.trofimow@yandex.ru>)
Список pgsql-hackers
On Tue, 27 Feb 2024 at 00:31, Ivan Trofimov <i.trofimow@yandex.ru> wrote:
> I see now that I failed to express myself clearly: it's not a per-query
> overhead, but rather a per-result-field one.

I'm fairly sympathetic to decreasing the overhead of any per-row
operation. And looking at the code, it doesn't surprise me that
PQfnumber shows up so big in your profile. I think it would probably
make sense to introduce a PQfnumber variant that does not do the
downcasing/quote handling (called e.g. PQfnumberRaw).

However, I do think you could convert this per-row overhead in your
case to per-query overhead by caching the result of PQfnumber for each
unique C++ string_view. Afaict that should solve your performance
problem.



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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: Synchronizing slots from primary to standby
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: [PATCH] updates to docs about HOT updates for BRIN