Re: BUG #14263: Query planner is slow to plan UPDATE on a table with many partitions

Поиск
Список
Период
Сортировка
От Andrew Gierth
Тема Re: BUG #14263: Query planner is slow to plan UPDATE on a table with many partitions
Дата
Msg-id 878twtsssp.fsf@news-spur.riddles.org.uk
обсуждение исходный текст
Ответ на BUG #14263: Query planner is slow to plan UPDATE on a table with many partitions  (shirshegsm@gmail.com)
Список pgsql-bugs
>>>>> "shirshegsm" == shirshegsm  <shirshegsm@gmail.com> writes:

 shirshegsm> After some discussion on #postgresql @ Freenode (abridged
 shirshegsm> version: https://paste.fedoraproject.org/393752/16805914/),
 shirshegsm> it seems that the query planner has O(n^2) complexity for
 shirshegsm> the number of partitions in a partitioned table.

To sum up my part of that discussion: the repeated calls to
adjust_appendrel_attrs cause an O(N^2) number of calls to palloc, as
query_tree_mutator calls range_table_mutator which does two pallocs per
RTE (one for the RTE and one for the listcell).

Also none of those get freed, as far as I can tell, so the memory usage
is O(N^2) too.

--
Andrew (irc:RhodiumToad)

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

Предыдущее
От: shirshegsm@gmail.com
Дата:
Сообщение: BUG #14263: Query planner is slow to plan UPDATE on a table with many partitions
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #14235: inconsistencies with IS NULL / IS NOT NULL