Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 797939FB6BB for ; Tue, 27 Feb 2007 04:14:26 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 37798-04 for ; Tue, 27 Feb 2007 04:14:16 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail01.enterprisedb.com (mail01.enterprisedb.com [63.246.7.168]) by postgresql.org (Postfix) with ESMTP id 26C769FB8E0 for ; Tue, 27 Feb 2007 04:14:18 -0400 (AST) thread-index: AcdaR01a2GD0eKmBS0uKoIu0DIUe0w== Received: from [192.168.0.22] ([81.6.226.224]) by mail01.enterprisedb.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 27 Feb 2007 03:14:28 -0500 Content-Class: urn:content-classes:message Subject: Re: Dead Space Map version 2 Importance: normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.2826 From: "Simon Riggs" To: "ITAGAKI Takahiro" Cc: In-Reply-To: <20070227113655.6381.ITAGAKI.TAKAHIRO@oss.ntt.co.jp> References: <20070227113655.6381.ITAGAKI.TAKAHIRO@oss.ntt.co.jp> Content-Type: text/plain; charset="iso-8859-1" Date: Tue, 27 Feb 2007 08:11:37 +0000 Message-ID: <1172563897.3760.540.camel@silverbirch.site> MIME-Version: 1.0 X-Mailer: Evolution 2.6.0 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 27 Feb 2007 08:14:28.0328 (UTC) FILETIME=[4CEF5680:01C75A47] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.068 tagged_above=0 required=5 tests=AWL, BAYES_50 X-Spam-Level: X-Archive-Number: 200702/1674 X-Sequence-Number: 99227 On Tue, 2007-02-27 at 12:05 +0900, ITAGAKI Takahiro wrote: > If we combine this with the HOT patch, pages with HOT tuples are probably > marked as UNFROZEN because we don't bother vacuuming HOT tuples. They can > be removed incrementally and doesn't require explicit vacuums. Perhaps avoid DSM entries for HOT updates completely? > VACUUM commands > --------------- > > VACUUM now only scans the pages that possibly have dead tuples. > VACUUM ALL, a new syntax, behaves as the same as before. > > - VACUUM FULL : Not changed. scans all pages and compress them. > - VACUUM ALL : Scans all pages; Do the same behavior as previous VACUUM. > - VACUUM : Scans only HIGH pages usually, but also LOW and UNFROZEN > pages on vacuums in the cases for preventing XID wraparound. Sounds good. > Performance issues > ------------------ > > * Enable/Disable DSM tracking per tables > DSM requires more or less additional works. If we know specific tables > where DSM does not work well, ex. heavily updated small tables, we can > disable DSM for it. The syntax is: > ALTER TABLE name SET (dsm=true/false); How about a dsm_tracking_limit GUC? (Better name please) The number of pages in a table before we start tracking DSM entries for it. DSM only gives worthwhile benefits for larger tables anyway, so let the user define what large means for them. dsm_tracking_limit = 1000 by default. > * Dead Space State Cache > The DSM management module is guarded using one LWLock, DeadSpaceLock. > Almost all accesses to DSM requires only shared lock, but the frequency > of shared lock was very high (tied with BufMappingLock) in my research. > To avoid the lock contention, I added a cache of dead space state in > BufferDesc flags. Backends see the flags first, and avoid locking if no > need to ISTM there should be a point at which DSM is so full we don't bother to keep track any longer, so we can drop that information. For example if user runs UPDATE without a WHERE clause, there's no point in tracking whole relation. > Memory management > ----------------- > > In current implementation, DSM allocates a bunch of memory at start up and > we cannot modify it in running. It's maybe enough because DSM consumes very > little memory -- 32MB memory per 1TB database. That sounds fine. -- Simon Riggs EnterpriseDB http://www.enterprisedb.com