Re: Is array_append O(n)?

Поиск
Список
Период
Сортировка
От Rob Nikander
Тема Re: Is array_append O(n)?
Дата
Msg-id BBFE0E5C-BC0C-446C-921A-E498DFFF48CC@gmail.com
обсуждение исходный текст
Ответ на Re: Is array_append O(n)?  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: Is array_append O(n)?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general

> On Jun 18, 2019, at 7:37 PM, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
>
> On 2019-Jun-18, Rob Nikander wrote:
>
>> Does `array_append(arr, elt)` create a new array and copy everything?
>> In other words, is it O(n) or O(1)? […]
>
> Starting with 9.5, there's an optimization that I think is supposed to
> make it O(1):

Sweet! Thanks. Now I’d like to know how to tell if that optimization is being used, or not.

Same question for the a way to pop an element off the end in O(1) time.







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

Предыдущее
От: Torsten Förtsch
Дата:
Сообщение: Re: Inserts restricted to a trigger
Следующее
От: Andres Freund
Дата:
Сообщение: Re: perf tuning for 28 cores and 252GB RAM