Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 66267133655C for ; Tue, 30 Nov 2010 13:42:32 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 74012-07 for ; Tue, 30 Nov 2010 17:42:25 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-yx0-f174.google.com (mail-yx0-f174.google.com [209.85.213.174]) by mail.postgresql.org (Postfix) with ESMTP id 25A301335B36 for ; Tue, 30 Nov 2010 13:42:24 -0400 (AST) Received: by yxt3 with SMTP id 3so2358856yxt.19 for ; Tue, 30 Nov 2010 09:42:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:references :in-reply-to:subject:date:message-id:mime-version:content-type :content-transfer-encoding:x-mailer:thread-index:content-language; bh=79sJtzgM2Y4Nk0ksRUfp65nnFTupv+MBg/sKTfQNlpI=; b=V3FFMklYyse2JbYGoR3i3wwv7NZC8QZU1PF7Kigc/S7zbhLgmu1vulCjMgfnltQLq6 Npv7CLPXs2KLHf3YVqpAuaxivKP381zVW5CRrcv2pH49a+/fgIJXF8MW9/Ae9Jxq4TeX gHA7M+EGqaIOZ6Alxfx2/I7e/wHiveuyEZtK4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:references:in-reply-to:subject:date:message-id :mime-version:content-type:content-transfer-encoding:x-mailer :thread-index:content-language; b=J22YcEPkbUTzCTVYHb68NwCxQYkvOOrSOKDjdAnv8b+jVKrkv7+CkI1+UD4cfprKHJ QCe8NjM26q1Rog9jIZQT1btgZtxpPmrn+mnixWUZVIWebf/C4/pxPrQoupO8wyr7+k1t +FOnavzqu1uUoIEOj/X+vZfRejAPaRhE50Iw8= Received: by 10.223.83.141 with SMTP id f13mr7142558fal.17.1291138944054; Tue, 30 Nov 2010 09:42:24 -0800 (PST) Received: from 345bf1f2bc8c491 ([114.143.126.120]) by mx.google.com with ESMTPS id 5sm655085fak.23.2010.11.30.09.42.20 (version=SSLv3 cipher=RC4-MD5); Tue, 30 Nov 2010 09:42:23 -0800 (PST) From: "Shridhar Polas" To: "'Kenneth Marshall'" Cc: References: <00b901cb90b3$ca9ddc40$5fd994c0$@gmail.com> <20101130172841.GK19162@aart.is.rice.edu> In-Reply-To: <20101130172841.GK19162@aart.is.rice.edu> Subject: Re: Space occupied by Postgres index. Date: Tue, 30 Nov 2010 23:12:23 +0530 Message-ID: <00c301cb90b5$f54b6370$dfe22a50$@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQJiMbSbzqbJdI/95BjGL5d7ZCvbMwK4EJMTkkdFDjA= Content-Language: en-us X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201011/260 X-Sequence-Number: 36226 Thanks for a quick response Ken. One more query:- If I do not perform VACUUM FULL and REINDEX, does Postgres reclaimed the space automatically when number of records in tables reduce after touching some limit? I mean the total disk space consumed by Postgres would ever be decline at any point without performing VACUUM FULL and REINDEX? In my test setup I found that the disk space consumed by Postgers is not getting declined even after deleting records from tables, if I do not perform VACUUM FULL and REINDEX. Thanks again Shridhar -----Original Message----- From: Kenneth Marshall [mailto:ktm@rice.edu] Sent: Tuesday, November 30, 2010 10:59 PM To: Shridhar Polas Cc: pgsql-admin@postgresql.org Subject: Re: [ADMIN] Space occupied by Postgres index. On Tue, Nov 30, 2010 at 10:56:53PM +0530, Shridhar Polas wrote: > Hi, > > > > I am facing a problem where indexes creates on some tables are > occupying huge space on disk and it seems to me that this space is not > getting reclaimed even when there are very few record in an associated table. > > > > When I ran full vacuum the disk space was reclaimed occupied by tables > but not by disk space occupied by indexes. > > > > Can somebody please tell me when disk space occupied by Postgres index > is reclaimed, without performing re-indexing on those tables? > > > > Thanks, > > Shridhar > VACUUM FULL will cause index bloat. You will need to REINDEX to recover the space. Note, you should not really need to use VACUUM FULL in a normal correctly configured system. Cheers, Ken