impact of truncate table on indexes

From: Dinesh Bhandary <dbhandary(at)iii(dot)com>
To: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: impact of truncate table on indexes
Date: 2011-12-22 18:06:00
Message-ID: 4EF37188.1000208@iii.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi All -

We have been having some performance issues with indexes right after
truncating a table. My understanding is truncate removes all the
contents of the table and the space get reclaimed immediately.
In such cases what happens to its indexes. It does not seem like they
are removed, but merely marked for deletion by a vacuum job and it
creates huge bloats and performance problems.

What is the best procedure in scenarios like this? Recreating indexes
seems to solve the problem, but I am trying to find out if there are
other alternatives out there.

Thanks.
Dinesh

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Benjamin Krajmalnik 2011-12-22 18:25:46 Re: Problem with pgstat timneouts
Previous Message Tom Lane 2011-12-22 17:54:33 Re: Problem with pgstat timneouts