Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 9EFE99FA097 for ; Thu, 28 Dec 2006 09:20:36 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 32028-07 for ; Thu, 28 Dec 2006 09:20:18 -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 3C5049F9F46 for ; Thu, 28 Dec 2006 09:20:29 -0400 (AST) thread-index: AccqgvSFca2XwWIYSYiIa2Qe8Ohq8A== Received: from [192.168.0.22] ([62.232.55.118]) by mail01.enterprisedb.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 28 Dec 2006 08:20:32 -0500 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.2757 Content-Class: urn:content-classes:message Importance: normal Subject: Re: Advice on selecting good values for work_mem? From: "Simon Riggs" To: "Bill Moran" Cc: "Tom Lane" , In-Reply-To: <20061218161805.04699b10.wmoran@collaborativefusion.com> References: <20061207113531.98095b27.wmoran@collaborativefusion.com> <16388.1165510978@sss.pgh.pa.us> <20061218161805.04699b10.wmoran@collaborativefusion.com> Content-Type: text/plain; charset="iso-8859-1" Date: Thu, 28 Dec 2006 13:19:44 +0000 Message-ID: <1167311984.3633.87.camel@silverbirch.site> MIME-Version: 1.0 X-Mailer: Evolution 2.6.0 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 28 Dec 2006 13:20:32.0765 (UTC) FILETIME=[F3CB4AD0:01C72A82] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/518 X-Sequence-Number: 22574 On Mon, 2006-12-18 at 16:18 -0500, Bill Moran wrote: > In response to Tom Lane : > > > Bill Moran writes: > > > Does the creation of a temp file trigger any logging? > > > > No; but it wouldn't be hard to add some if you wanted. I'd do it at > > deletion, not creation, so you could log the size the file reached. > > See FileClose() in src/backend/storage/file/fd.c. > > Is this along the lines of what you were thinking? Is this acceptable > to get pulled into the tree (maintaining local patches sucks ;) I've > only been using this patch a day and I'm already giddy about how much > it helps tuning work memory sizes ... You need to submit to patches, not here. Patch looks right, but needs some extra things: - activate based upon a GUC called trace_temp_files (?) to be added in src/backend/utils/misc/guc.c - using a temp file is a problem only in the eye of the beholder, so let the admin decide whether to show the info or not (default not) - level LOG not WARNING, with no hint message (?) - message should be something like "temp file: size %s path: %s" so we can see where the file was created (there is another todo about creating temp files in different locations) - add a trace point also for those who don't want to enable a parameter, described here http://www.postgresql.org/docs/8.2/static/dynamic-trace.html e.g. PGTRACE1(temp__file__cleanup, filestats.st_size) -- Simon Riggs EnterpriseDB http://www.enterprisedb.com