X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 86256D1B42F for ; Wed, 26 Nov 2003 18:22:02 +0000 (GMT) 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 83527-10 for ; Wed, 26 Nov 2003 14:21:37 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 9DE1CD1B431 for ; Wed, 26 Nov 2003 14:21:30 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id hAQILaNu003602 for ; Wed, 26 Nov 2003 18:21:36 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id hAQHqQEI097838 for pgsql-admin@postgresql.org; Wed, 26 Nov 2003 17:52:26 GMT From: "nobody" X-Newsgroups: comp.databases.postgresql.admin Subject: Re: Vacuum stats interpreted? Date: Wed, 26 Nov 2003 17:52:12 -0000 Organization: Hub.Org Networking Services Lines: 55 Message-ID: References: <6b79e0aa2a1c3668937e1ce087c4a819@news.teranews.com> X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 To: pgsql-admin@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/455 X-Sequence-Number: 11442 To test your theory about COMMIT; BEGIN; you could check the PostgreSQL log, it is likely to contain a line: WARNING: there is no transaction in progress "Jeff Boes" wrote in message news:6b79e0aa2a1c3668937e1ce087c4a819@news.teranews.com... > Our largest (by total byte count) table has a nearly-equal flow of data in and > out on a daily basis (that is, we add some 40k rows during the day, and then > every night expire stuff that is timestamped beyond our cutoff, which results in > about 40k deletions). > > After the deletions, the table gets vacuumed (not FULL): > > INFO: --Relation public.articles_content-- > INFO: Index ix_articles_content_pk: Pages 398; Tuples 180175: Deleted 0. > CPU 0.00s/0.08u sec elapsed 0.08 sec. > INFO: Removed 122 tuples in 77 pages. > CPU 0.00s/0.01u sec elapsed 0.02 sec. > INFO: Pages 3886: Changed 0, Empty 0; Tup 180175: Vac 122, Keep 26437, UnUsed > 135721. > Total CPU 0.02s/0.17u sec elapsed 0.19 sec. > INFO: --Relation pg_toast.pg_toast_634643688-- > INFO: Index pg_toast_634643688_index: Pages 27156; Tuples 1256923: Deleted 732. > CPU 2.32s/0.80u sec elapsed 27.93 sec. > INFO: Removed 732 tuples in 250 pages. > CPU 0.01s/0.04u sec elapsed 0.05 sec. > INFO: Pages 1667633: Changed 71514, Empty 0; Tup 1256923: Vac 732, Keep 172914, > UnUsed 5499031. > Total CPU 148.07s/12.52u sec elapsed 809.71 sec. > INFO: Analyzing public.articles_content > > The "Keep" and "UnUsed" numbers seem high to me, compared to other tables. Can > anyone interpret these and tell me anything about what we could do with this > table to make it "look" better? (I'm not convinced that the extra space affects > anything but sequential scans, and we don't do that to this table.) > > If it helps: I have a theory that database connections from our webserver (which > is running PHP and mod_perl) are in "idle in transaction" states (in other > words, they issue "Commit; Begin;" and then sleep), which causes the tables to > retain bulk (nice image, eh?). >