pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: dbhandary@iii.com
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: impact of truncate table on indexes
Date: Thu, 22 Dec 2011 13:40:22 -0500
Message-ID: <17582.1324579222@sss.pgh.pa.us> (raw)
In-Reply-To: <4EF37188.1000208@iii.com>
References: <4EF37188.1000208@iii.com>

Dinesh Bhandary <dbhandary@iii.com> writes:
> We have been having some performance issues with indexes right after 
> truncating a table.

You'd need to be a lot more specific than that if you want useful help.
Also, pgsql-performance is a better list for discussing performance
issues.
http://wiki.postgresql.org/wiki/SlowQueryQuestions

> 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.

They get rebuilt as empty 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.

On what do you base this clearly-contrary-to-reality conclusion?

			regards, tom lane



view thread (2+ messages)

Message-ID: <17582.1324579222@sss.pgh.pa.us>
Permalink:  ../17582.1324579222@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/17582.1324579222@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, dbhandary@iii.com
  Subject: Re: impact of truncate table on indexes
  In-Reply-To: <17582.1324579222@sss.pgh.pa.us>

* 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