Re: append_array causes rapid growth according to pg_total_relation_size

From: Randall Smith <randall(at)tnr(dot)cc>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: append_array causes rapid growth according to pg_total_relation_size
Date: 2010-08-23 06:31:44
Message-ID: 1282545104.2139.9.camel@randall-laptop
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

More information including a workaround.

VACUUM ANALYZE is not freeing space after an array_append, but it does
after replacing a specific element in the array.

So if I do this:

update array_big1 set chunk_ids = array_append(chunk_ids, '1') where id
= 0;
update array_big1 set chunk_ids[1] = chunk_ids[1] where id = 0;

VACUUM ANALYZE reclaims the growth caused by array_append.

-Randall

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mike Christensen 2010-08-23 06:41:56 Re: Npgsql Exception
Previous Message Mike Christensen 2010-08-23 03:54:12 Npgsql Exception