Re: ALTER TABLE DROP COLUMN

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: The Hermit Hacker <scrappy(at)hub(dot)org>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>, PostgreSQL Development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: ALTER TABLE DROP COLUMN
Date: 2000-10-09 21:43:50
Message-ID: 7276.971127830@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The Hermit Hacker <scrappy(at)hub(dot)org> writes:
>> It is not. The only downside is 2x disk space to make new versions of
>> the tuple.

> huh? vacuum moves/cleans up tuples, as well as compresses them, so that
> the end result is a smaller table then what it started with, at/with very
> little increase in the total size/space needed to perform the vacuum ...

Huh? right back at you ;-). Vacuum is very careful to make sure that
it always has two copies of any tuple it moves. The reason it's not 2x
disk space is that it only moves tuples to fill free space in existing
pages of the file. So the moved tuples take up space-that-was-free as
well as the space they were originally in. But this has nothing
whatever to do with the requirements of ALTER DROP COLUMN --- to be
safe, that must have two copies of every tuple, free space or no free
space.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-10-09 22:09:17 Re: ALTER TABLE DROP COLUMN
Previous Message The Hermit Hacker 2000-10-09 21:36:05 Re: ALTER TABLE DROP COLUMN