X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 474DD3A4922 for ; Fri, 26 Nov 2004 03:25:34 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 91877-06 for ; Fri, 26 Nov 2004 03:25:26 +0000 (GMT) Received: from sue.samurai.com (sue.samurai.com [205.207.28.74]) by svr1.postgresql.org (Postfix) with ESMTP id 7669F3A4912 for ; Fri, 26 Nov 2004 03:25:29 +0000 (GMT) Received: from localhost (localhost [127.0.0.1]) by sue.samurai.com (Postfix) with ESMTP id A8C56197F3; Thu, 25 Nov 2004 22:25:30 -0500 (EST) Received: from sue.samurai.com ([127.0.0.1]) by localhost (sue.samurai.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 26317-02; Thu, 25 Nov 2004 22:25:29 -0500 (EST) Received: from fjgateway (unknown [61.88.101.19]) by sue.samurai.com (Postfix) with ESMTP id 165EC197F2; Thu, 25 Nov 2004 22:25:27 -0500 (EST) Subject: Re: Postgres vs. DSpam From: Neil Conway To: Andrew McMillan Cc: Evilio del Rio , dspam-users@networkdweebs.com, pgsql-performance@postgresql.org In-Reply-To: <1101433032.16058.57.camel@lamb.mcmillan.net.nz> References: <1101302058.338.74.camel@haddock.cmima.csic.es> <1101433032.16058.57.camel@lamb.mcmillan.net.nz> Content-Type: text/plain Date: Fri, 26 Nov 2004 14:25:25 +1100 Message-Id: <1101439525.12697.11.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at mailbox.samurai.com X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/403 X-Sequence-Number: 9357 On Fri, 2004-11-26 at 14:37 +1300, Andrew McMillan wrote: > In PostgreSQL the UPDATE will result > internally in a new record being written, with the old record being > marked as deleted. That old record won't be re-used until after a > VACUUM has run, and this means that the on-disk tables will have a lot > of dead rows in them quite quickly. Not necessarily: yes, you need a VACUUM to begin reusing the space consumed by expired tuples, but that does not mean "tables will have a lot of dead rows in them quite quickly". VACUUM does not block concurrent database activity, so you can run it as frequently as you'd like (and as your database workload requires). There is a tradeoff between the space consumed by expired tuple versions and the I/O required to do a VACUUM -- it's up to the PG admin to decide what the right balance for their database is (pg_autovacuum et al. can help make this decision). > The reason that PostgreSQL operates this way, is a direct result of the > way transactional support is implemented, and it may well change in a > version or two. I doubt it. -Neil