Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 7B32F9FA2D0 for ; Thu, 21 Jun 2007 13:53:50 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 45689-08 for ; Thu, 21 Jun 2007 13:53:46 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from floppy.pyrenet.fr (floppy.pyrenet.fr [194.116.145.2]) by postgresql.org (Postfix) with ESMTP id 329C49FA3AD for ; Thu, 21 Jun 2007 13:53:45 -0300 (ADT) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id 6789A31436; Thu, 21 Jun 2007 18:53:43 +0200 (MET DST) From: "Sabin Coanda" X-Newsgroups: pgsql.performance Subject: vacuum a lot of data when insert only Date: Thu, 21 Jun 2007 19:53:54 +0300 Organization: Hub.Org Networking Services Lines: 54 Message-ID: X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original To: pgsql-performance@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=AWL=0.049, BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200706/474 X-Sequence-Number: 25507 Hi there, Reading different references, I understand there is no need to vacuum a table where just insert actions perform. So I'm surprising to see a table with just historical data, which is vacuumed at the nightly cron with a simple VACUUM VERBOSE on about 1/3 of indexes amount. Take a look on the fragment log concerning this table: INFO: vacuuming "public.tbTEST" INFO: scanned index "tbTEST_pkey" to remove 1357614 row versions DETAIL: CPU 0.31s/1.38u sec elapsed 4.56 sec. INFO: "tbTEST": removed 1357614 row versions in 16923 pages DETAIL: CPU 0.70s/0.13u sec elapsed 2.49 sec. INFO: index "tbTEST_pkey" now contains 2601759 row versions in 12384 pages DETAIL: 1357614 index row versions were removed. 5415 index pages have been deleted, 2452 are currently reusable. CPU 0.00s/0.00u sec elapsed 0.00 sec. INFO: "tbTEST": found 1357614 removable, 2601759 nonremovable row versions in 49153 pages DETAIL: 0 dead row versions cannot be removed yet. There were 29900 unused item pointers. 16923 pages contain useful free space. 0 pages are entirely empty. CPU 2.12s/1.87u sec elapsed 11.41 sec. INFO: "tbTEST": truncated 49153 to 32231 pages DETAIL: CPU 0.23s/0.06u sec elapsed 0.31 sec. I found the following statistics in pg_stat_user_tables: n_tup_ins = 11444229 n_tup_upd = 0 n_tup_del = 0 The structure of the table is the following: CREATE TABLE "tbTEST" ( "PK_ID" integer NOT NULL DEFAULT nextval('"tbTEST_PK_ID_seq"'::regclass), "FK_SourceTypeID" integer, "SourceID" integer DEFAULT -1, "Message" character varying(500) NOT NULL DEFAULT ''::character varying, "DateAndTime" timestamp without time zone NOT NULL, CONSTRAINT "tbTEST_pkey" PRIMARY KEY ("PK_ID"), CONSTRAINT "tbTEST_FK_SourceTypeID_fkey" FOREIGN KEY ("FK_SourceTypeID") REFERENCES "tbLISTS" ("PK_ID") MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION ) Postgres version is 8.2.3. What's happen ? TIA, Sabin