Re: Speeding up INSERTs and UPDATEs to partitioned tables

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Speeding up INSERTs and UPDATEs to partitioned tables
Дата
Msg-id 17610.1532623666@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Speeding up INSERTs and UPDATEs to partitioned tables  (David Rowley <david.rowley@2ndquadrant.com>)
Список pgsql-hackers
David Rowley <david.rowley@2ndquadrant.com> writes:
> 1) Got rid of PARTITION_ROUTING_MAXSIZE. The code using this was
> useless since the int would have wrapped long before it reached
> UINT_MAX. There's no shortage of other code doubling the size of an
> array by multiplying it by 2 unconditionally without considering
> overflowing an int. Unsure why you considered this more risky.

As long as you're re-palloc'ing the array each time, and not increasing
its size more than 2X, this is perfectly safe because of the 1GB size
limit on palloc requests.  You'll fail because of that in the iteration
where the request is between 1GB and 2GB, just before integer overflow
can occur.

(Yes, this is intentional.)

            regards, tom lane


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

Предыдущее
От: Cynthia Shang
Дата:
Сообщение: Re: Allow COPY's 'text' format to output a header
Следующее
От: Dean Rasheed
Дата:
Сообщение: Re: [HACKERS] [PATCH] Overestimated filter cost and its mitigation