X-Original-To: pgsql-admin@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 0F55D475F2C for ; Tue, 29 Apr 2003 19:37:16 -0400 (EDT) Received: from hampden.charm.net (hampden.charm.net [207.114.0.146]) by postgresql.org (Postfix) with ESMTP id 4AFC7475CBC for ; Tue, 29 Apr 2003 19:37:15 -0400 (EDT) Received: from [192.168.0.100] (guthrie.charm.net [209.143.110.37]) by hampden.charm.net (8.12.9/8.12.9/LNSG+ORDB+OSS+SCOP+NJABL+RSL+SBL+SPEWS+DSBL) with ESMTP id h3TNbDXv018487 for ; Tue, 29 Apr 2003 19:37:13 -0400 (EDT) (envelope-from pgadmin.12.ptechjohn@spamgourmet.com) Subject: vacuuming and freed disk space From: john Reply-To: pgadmin.12.ptechjohn@spamgourmet.com To: pgsql-admin@postgresql.org Content-Type: text/plain Organization: Message-Id: <1051659428.2570.88.camel@bing> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.0 Date: 29 Apr 2003 19:37:08 -0400 Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=-12.1 required=5.0 tests=BAYES_10,USER_AGENT_XIMIAN autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/394 X-Sequence-Number: 8549 i am looking at our database table maintenance. we are running a "space watch" task that looks at available disk space and removes old records when/if a certain threshold is passed. i've noticed that if i run a "bulk delete" followed by a vacuum the actual disk space is usually not recovered. if i use "vacuum full" instead of just plain "vacuum" the space is recovered (i am using df to look at the partition usage statistics). also, if i run just plain "vacuum" and wait around for a bit, eventually the space will be recovered. i haven't nailed down whether this is because of other usage or something that the server does... so, the questions: 1) is there a way to recover the disk space without doing a "vacuum full"? i don't want to do the table lock if i don't have to. 2) *is* the postgresql server periodically recovering that disk space? if so, how often does it do this, and does it lock the table when it does? 3) anyone have any other good ideas on how to implement this sort of "space watch" functionality? thanks. john -- john