pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dinesh Bhandary <dbhandary@iii.com>
To: pgsql-admin <pgsql-admin@postgresql.org>
Subject: impact of truncate table on indexes
Date: Thu, 22 Dec 2011 10:06:00 -0800
Message-ID: <4EF37188.1000208@iii.com> (raw)

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



view thread (2+ messages)  latest in thread

Message-ID: <4EF37188.1000208@iii.com>
Permalink:  ../4EF37188.1000208@iii.com/
Also on:    postgresql.org/message-id/4EF37188.1000208@iii.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: dbhandary@iii.com
  Subject: Re: impact of truncate table on indexes
  In-Reply-To: <4EF37188.1000208@iii.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox