X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id E4C72D1BCA7 for ; Fri, 21 May 2004 18:32:17 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 48696-04 for ; Fri, 21 May 2004 18:31:54 -0300 (ADT) Received: from snowwhite.lulu.com (stymie.lulu.com [66.193.5.50]) by svr1.postgresql.org (Postfix) with ESMTP id 2D584D1D299 for ; Fri, 21 May 2004 18:29:33 -0300 (ADT) Received: from lulu.com (meatwad.rdu.lulu.com [10.0.0.32]) (authenticated) by snowwhite.lulu.com (8.11.6/8.11.6) with ESMTP id i4LLTQn09991 for ; Fri, 21 May 2004 17:29:26 -0400 Message-ID: <40AE74BD.5050802@lulu.com> Date: Fri, 21 May 2004 17:29:33 -0400 From: Bill Montgomery User-Agent: Mozilla Thunderbird 0.5 (X11/20040210) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: Avoiding vacuum full on an UPDATE-heavy table References: <40AE274F.7020800@lulu.com> <54139.192.154.91.225.1085167360.squirrel@192.154.91.225> In-Reply-To: <54139.192.154.91.225.1085167360.squirrel@192.154.91.225> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200405/190 X-Sequence-Number: 7021 Matthew T. O'Connor wrote: >>Is there any way to avoid doing a periodic VACUUM FULL on this table, >>given the fairly radical usage pattern? Or is the (ugly) answer to >>redesign our application to avoid this usage pattern? >> >> >pg_autovacuum would probably help as it monitors activity and vacuumus >tables accordingly. It is not included with 7.3.x but if you download it >and compile yourself it will work against a 7.3.x server. > > As a quick fix, since we're upgrading to 7.4.2 in a few weeks anyhow (which includes pg_autovacuum), I've simply set up an hourly vacuum on this table. It only takes ~4 seconds to execute when kept up on an hourly basis. Is there any penalty to vacuuming too frequently, other than the time wasted in an unnecessary vacuum operation? My hourly VACUUM VERBOSE output now looks like this: INFO: --Relation public.xxxx-- INFO: Index xxxx_yyyy_idx: Pages 30452; Tuples 34990: Deleted 1226. CPU 0.67s/0.18u sec elapsed 0.87 sec. INFO: Index xxxx_yyyy_idx: Pages 19054; Tuples 34991: Deleted 1226. CPU 0.51s/0.13u sec elapsed 1.35 sec. INFO: Removed 1226 tuples in 137 pages. CPU 0.01s/0.00u sec elapsed 1.30 sec. INFO: Pages 13709: Changed 31, Empty 0; Tup 34990: Vac 1226, Keep 0, UnUsed 567233. Total CPU 1.58s/0.31u sec elapsed 3.91 sec. INFO: Analyzing public.xxxx VACUUM With regards to Vivek's post about index bloat, I tried REINDEXing before I did a VACUUM FULL a month ago when performance had gotten dismal. It didn't help :-( Best Regards, Bill Montgomery