Re: does vacuum rebuild index?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: mikeo <mikeo(at)spectrumtelecorp(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: does vacuum rebuild index?
Date: 2000-06-12 21:20:12
Message-ID: 2612.960844812@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

mikeo <mikeo(at)spectrumtelecorp(dot)com> writes:
> we have a 34 million row table. after many inserts, updates, deletes
> the performance degraded so we vacuumed the table. the output indicated
> that the index was also vacuumed but the size didn't change. it was still
> 80m so we dropped and recreated it reducing it to 20m.

This is in the FAQ isn't it? VACUUM removes unused index entries but it
doesn't reduce the physical size of the index file. There's an item on
the TODO list to fix that, but for now a lot of people are in the habit
of doing
drop indexes;
vacuum;
recreate indexes;

This is often faster than what vacuum does, so there's been talk of
changing vacuum to work that way, but there's concern about what happens
if vacuum crashes before it's rebuilt the indexes... at least with the
delete-unused-entries approach you aren't left with an incomplete index.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Palle Girgensohn 2000-06-13 00:08:59 Re: FreeBSD PostgreSQL7 port and v7.0.2
Previous Message mikeo 2000-06-12 21:02:37 does vacuum rebuild index?