X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id D14FED1B52B for ; Mon, 8 Sep 2003 14:05:05 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 49531-01 for ; Mon, 8 Sep 2003 11:04:37 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 7B857D1B520 for ; Mon, 8 Sep 2003 11:04:32 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h88E4XAn009958; Mon, 8 Sep 2003 10:04:33 -0400 (EDT) To: Andri Saar Cc: Hannu Krosing , pgsql-performance@postgresql.org Subject: Re: Serious issues with CPU usage In-reply-to: <200309081350.23312.andris@estpak.ee> References: <20030905215635.68C1173595@MX2.estpak.ee> <28675.1062806700@sss.pgh.pa.us> <200309081350.23312.andris@estpak.ee> Comments: In-reply-to Andri Saar message dated "Mon, 08 Sep 2003 13:50:23 +0300" Date: Mon, 08 Sep 2003 10:04:33 -0400 Message-ID: <9957.1063029873@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/121 X-Sequence-Number: 3487 Andri Saar writes: > If this is the best you can get with postgres right now, then I'll just have > to increase the frequency of VACUUMing, but that feels like a hackish > solution :( Not at all. The overhead represented by VACUUM would have to be paid somewhere, somehow, in any database. Postgres allows you to control exactly when it gets paid. It looks to me like throwing a plain VACUUM into your poller cycle (or possibly VACUUM ANALYZE depending on how fast the table's stats change) would solve your problems nicely. Note that once you have that policy in place, you will want to do one VACUUM FULL, and possibly a REINDEX, to get the table's physical size back down to something commensurate with 2700 useful rows. I shudder to think of where it had gotten to before. Routine VACUUMing should hold it to a reasonable size after that. regards, tom lane