Re: Generating partitioning tuple conversion maps faster

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: Generating partitioning tuple conversion maps faster
Дата
Msg-id CAKJS1f8Rdhkq_xXQhT=O1puJ_=S35=e-C9sbGhoCs-FYgzVFkQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Generating partitioning tuple conversion maps faster  (Alexander Kuzmenkov <a.kuzmenkov@postgrespro.ru>)
Ответы Re: Generating partitioning tuple conversion maps faster  (David Rowley <david.rowley@2ndquadrant.com>)
Список pgsql-hackers
On 29 June 2018 at 02:23, Alexander Kuzmenkov
<a.kuzmenkov@postgrespro.ru> wrote:
> I think I found one possible reason for this slowness. Your patch behaves as
> expected when there is a dropped output column, but does one extra
> comparison when there is a dropped input column. This backwards conversion
> is called from ExecInitRoutingInfo. To fix this, I'd just keep a persistent
> inner loop counter (see the attached patch).

It's just 2000 comparisons vs 1000.

> Still, fixing this doesn't improve the performance. According to perf
> report, updatepd.sql spends 25% of time in strcmp, and updatep.sql about
> 0.5%, but they are comparing the same column names, even with the same
> alignment and relative offsets. I'm completely puzzled by this.

On further inspection, the slowdown is coming from the planner in
make_inh_translation_list(). The INSERT path does not hit that since
the planner's job is pretty simple for simple INSERTs.

> As a side thought, we wouldn't have to go through this if we had a hash
> table that is easy to use, or perhaps string interning in catcache.

Maybe it's better to try the direct lookup and fall back on
SearchSysCacheAttName() if the same attnum does not have the same
name.


-- 
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Server crashed with "TRAP: unrecognized TOAST vartag("1", File:"heaptuple.c", Line: 1490)"
Следующее
От: Chapman Flack
Дата:
Сообщение: Re: SQL/JSON: documentation