X-Original-To: pgsql-admin@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 2A9C44763D6 for ; Wed, 14 May 2003 11:36:41 -0400 (EDT) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with ESMTP id 67085-02 for ; Wed, 14 May 2003 11:36:37 -0400 (EDT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id B747647642C for ; Wed, 14 May 2003 11:34:36 -0400 (EDT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id C9D02D615; Wed, 14 May 2003 08:34:41 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id BF6255C04; Wed, 14 May 2003 08:34:41 -0700 (PDT) Date: Wed, 14 May 2003 08:34:41 -0700 (PDT) From: Stephan Szabo To: PRAGATI SAVAIKAR Cc: Subject: Re: Query About vacuum and pg_dump In-Reply-To: <3EB9DD6B.A3CCFB03@phil.com.sg> Message-ID: <20030514082634.Y44794-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/173 X-Sequence-Number: 8735 On Thu, 8 May 2003, PRAGATI SAVAIKAR wrote: > We have got "PostgreSQL 7.2.1 on i686-pc-linux-gnu, compiled by GCC > 2.96 " running on Linux 7.3. > There are 2 databases , each of size 16 GB. > > I have 2 queries regarding vacuum and pg_dump. > > VACUUM : > > We run "vacuum " for each of the table in the database on daily basis. > But it doesn't seem to reduce the disk space. > We also tried using "vacuum analyze". But no change was observed. Vacuum (without full) will generally only mark the free space as usable by later updates or inserts. Vacuum full will attempt to move rows around in order to shrink the actual table, however it takes an exclusive lock while doing so. > pg_dump: > we use pg_dump command to take the backup of the databases . > I would like to know, how will it affect if I run the pg_dump while the > tables are being used or when the transactions are being processed. IIRC, pg_dump runs all its queries in a serializable transaction, so inserts, updates and deletes to a table shouldn't affect the dumped data for that table.