Re: update, truncate and vacuum

From: "Luke Lonergan" <LLonergan(at)greenplum(dot)com>
To: "Scott Feldstein" <Scott(dot)Feldstein(at)hyperic(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: update, truncate and vacuum
Date: 2007-07-26 23:17:32
Message-ID: C3E62232E3BCF24CBA20D72BFDCB6BF8044A19A1@MI8NYCMAIL08.Mi8.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

1) Yes

All rows are treated the same, there are no in place updates.

2) No

Truncate recreates the object as a new one, releasing the space held by the old one.

- Luke

Msg is shrt cuz m on ma treo

-----Original Message-----
From: Scott Feldstein [mailto:scott(dot)feldstein(at)hyperic(dot)com]
Sent: Thursday, July 26, 2007 06:44 PM Eastern Standard Time
To: pgsql-performance(at)postgresql(dot)org
Subject: [PERFORM] update, truncate and vacuum

Hi,
I have a couple questions about how update, truncate and vacuum would
work together.

1) If I update a table foo (id int, value numeric (20, 6))
with
update foo set value = 100 where id = 1

Would a vacuum be necessary after this type of operation since the
updated value is a numeric? (as opposed to a sql type where its size
could potentially change i.e varchar)

2) After several updates/deletes to a table, if I truncate it, would
it be necessary to run vacuum in order to reclaim the space?

thanks,
Scott

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
message can get through to the mailing list cleanly

Browse pgsql-performance by date

  From Date Subject
Next Message Jim Nasby 2007-07-26 23:27:59 Re: Affect of Reindexing on Vacuum Times
Previous Message Dave Dutcher 2007-07-26 22:59:58 Re: update, truncate and vacuum