[GENERAL] Performance appending to an array column - Mailing list pgsql-general

From Paul A Jungwirth
Subject [GENERAL] Performance appending to an array column
Date
Msg-id CA+renyVoVqtcQ+KvxzABEeYuAJXrah90432RxEJCPrOFOxLU7Q@mail.gmail.com
Whole thread Raw
Responses Re: [GENERAL] Performance appending to an array column  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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 by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: [GENERAL] a JOIN to a VIEW seems slow
Next
From: Tom Lane
Date:
Subject: Re: [GENERAL] Performance appending to an array column