X-Original-To: pgsql-performance@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 3503A4762D7 for ; Mon, 24 Feb 2003 15:58:27 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 73540-05 for ; Mon, 24 Feb 2003 15:58:16 -0500 (EST) Received: from localhost.localdomain (unknown [65.217.53.66]) by postgresql.org (Postfix) with ESMTP id 3740647606A for ; Mon, 24 Feb 2003 14:59:00 -0500 (EST) Received: from thorn.mmrd.com (thorn.mmrd.com [172.25.10.100]) by localhost.localdomain (8.12.5/8.12.5) with ESMTP id h1OKR66P022704; Mon, 24 Feb 2003 15:27:06 -0500 Received: from gnvex001.mmrd.com (gnvex001.mmrd.com [192.168.3.55]) by thorn.mmrd.com (8.11.6/8.11.6) with ESMTP id h1OJwvp29064; Mon, 24 Feb 2003 14:58:57 -0500 Received: from camel.mmrd.com ([172.25.5.213]) by gnvex001.mmrd.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id F3HTHDTP; Mon, 24 Feb 2003 14:58:57 -0500 Subject: Re: slow query From: Robert Treat To: Josh Berkus Cc: Clarence Gardner , Oleg Lebedev , "pgsql-performance@postgresql.org" In-Reply-To: <200302241045.20856.josh@agliodbs.com> References: <1046111434.1014.165.camel@camel> <200302241045.20856.josh@agliodbs.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.8 Date: 24 Feb 2003 14:58:57 -0500 Message-Id: <1046116737.1014.284.camel@camel> Mime-Version: 1.0 X-Virus-Scanned: by amavisd-new X-Archive-Number: 200302/190 X-Sequence-Number: 1246 On Mon, 2003-02-24 at 13:45, Josh Berkus wrote: > Robert, > > > Actually if you are vacuuming frequently enough, it can (and should*) > > obviate a vacuum full. Be aware that frequently enough might mean really > > frequent, for instance I have several tables in my database that update > > every row within a 15 minute timeframe, so I run a "lazy" vacuum on > > these tables every 10 minutes. This allows postgresql to reuse the space > > for these tables almost continuously so I never have to vacuum full > > them. > > This would assume absolutely perfect FSM settings, and that the DB never gets > thrown off by unexpected loads. I have never been so fortunate as to work > with such a database. However, I agree that good FSM tuning and frequent > regular VACUUMs can greatly extend the period required for running FULL. > It's somewhat relative. On one of my tables, it has about 600 rows, each row gets updated within 15 minutes. I vacuum it every 10 minutes, which should leave me with around 1000 tuples (dead and alive) for that table, Even if something overload the updates on that table, chances are that I wouldn't see enough of a performance drop to warrant a vacuum full. Of course, its a small table, so YMMV. I think the point is though that if your running nightly vacuum fulls just to stay ahead of the game, your not maintaining the database optimally. > I have not found, though, that this does anything to prevent the need for > REINDEX on frequently-updated tables. How about you, Robert? > Well, this touches on a different topic. On those tables where I get "index bloat", I do have to do REINDEX's. But that's not currently solvable with vacuum (remember indexes dont even use FSM) though IIRC Tom & Co. have done some work toward this for 7.4 Robert Treat