Re: Explain is slow with tables having many columns

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: Explain is slow with tables having many columns
Дата
Msg-id 20180924195048.7dhnjvq5ggwjtiwi@alap3.anarazel.de
обсуждение исходный текст
Ответ на Explain is slow with tables having many columns  (legrand legrand <legrand_legrand@hotmail.com>)
Список pgsql-performance
Hi,

(CCing -hackers)

On 2018-09-24 12:22:28 -0700, legrand legrand wrote:
> I have found that explain on tables with many (hundreds) columns
> are slow compare to nominal executions.

Yea, colname_is_unique() (called via make_colname_unique()) is
essentially O(#total_columns) and rougly called once for each column in
a select list (or using or ...).  IIRC we've hit this once when I was at
citus, too.

We really should be usign a more appropriate datastructure here - very
likely a hashtable.  Unfortunately such a change would likely be a bit
too much to backpatch...

Greetings,

Andres Freund


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

Предыдущее
От: legrand legrand
Дата:
Сообщение: Re: Explain is slow with tables having many columns
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Explain is slow with tables having many columns