[GENERAL] Performance appending to an array column

Поиск
Список
Период
Сортировка
От Paul A Jungwirth
Тема [GENERAL] Performance appending to an array column
Дата
Msg-id CA+renyVoVqtcQ+KvxzABEeYuAJXrah90432RxEJCPrOFOxLU7Q@mail.gmail.com
обсуждение исходный текст
Ответы Re: [GENERAL] Performance appending to an array column  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
I'm considering a table structure where I'd be continuously appending
to long arrays of floats (10 million elements or more). Keeping the
data in arrays gives me much faster SELECT performance vs keeping it
in millions of rows.

But since these arrays keep growing, I'm wondering about the UPDATE
performance. I was reading this commit message about improving
performance of *overwriting* individual array elements, and I was
wondering if there is anything similar for growing an array column?:

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=1dc5ebc9077ab742

Is there a faster way to append to an array than just this?:
   UPDATE measurements   SET vals = vals || ARRAY[5.0, 4.2, 9.9]::float[]   ;

Thanks!
Paul


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

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

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: [GENERAL] a JOIN to a VIEW seems slow
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [GENERAL] Performance appending to an array column