X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 157839FAE4E for ; Sun, 30 Apr 2006 07:30:09 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 07868-04 for ; Sun, 30 Apr 2006 07:30:00 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from hotmail.com (bay101-f38.bay101.hotmail.com [64.4.56.48]) by postgresql.org (Postfix) with ESMTP id C52B59F9AFD for ; Sun, 30 Apr 2006 07:29:59 -0300 (ADT) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Sun, 30 Apr 2006 03:29:57 -0700 Message-ID: Received: from 64.4.56.200 by by101fd.bay101.hotmail.msn.com with HTTP; Sun, 30 Apr 2006 10:29:55 GMT X-Originating-IP: [84.210.10.106] X-Originating-Email: [bealach_na_bo@hotmail.com] X-Sender: bealach_na_bo@hotmail.com In-Reply-To: <200604281043.16083@hal.medialogik.com> From: "Bealach-na Bo" To: ahodgson@simkin.ca, pgsql-performance@postgresql.org Subject: Re: Why so slow? Date: Sun, 30 Apr 2006 10:29:55 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-OriginalArrivalTime: 30 Apr 2006 10:29:57.0740 (UTC) FILETIME=[0746EAC0:01C66C41] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200604/700 X-Sequence-Number: 18784 >If you don't need access to the old data constantly: > > - copy the live data to a new table > - TRUNCATE the old table (which needs an exclusive lock but is very fast) > - insert the data back in > - for an event log I would imagine this could work Obtaining exclusive locks on this table is very difficult, or rather, will make life very difficult for others, so I'm averse to running vacuum full or truncate (though I don't know how fast truncate is) on a regular basis. I might just get away with running it once a month, but no more. (Lazy) vacuum, however is a much more palatable option. But (lazy) vacuum does not always reclaim space. Will this affect performance and does this mean that a full vacuum is unavoidable? Or can I get away with daily (lazy) vacuums? Disk space is not an issue for me, but performance is a BIG issue. Of course, I realize that I could improve the latter with better schema design - I'm working on a new schema, but can't kill this one yet :|. Regards, Bealach