X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id C81C6D1E993 for ; Fri, 16 Apr 2004 18:53:37 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 01765-04 for ; Fri, 16 Apr 2004 18:53:33 -0300 (ADT) Received: from silmaril.syscor.priv (h24-108-208-253.sbm.shawcable.net [24.108.208.253]) by svr1.postgresql.org (Postfix) with ESMTP id B6110D1E981 for ; Fri, 16 Apr 2004 18:53:34 -0300 (ADT) Received: from syscor.com (strider.syscor.priv [192.168.1.3]) by silmaril.syscor.priv (8.12.8/8.12.8) with ESMTP id i3GLrqXR017338 for ; Fri, 16 Apr 2004 14:53:53 -0700 Message-ID: <4080562F.6050006@syscor.com> Date: Fri, 16 Apr 2004 14:54:55 -0700 From: Ron St-Pierre User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: Index Problem? References: <40800CC2.3050707@syscor.com> <200404161001.52989.josh@agliodbs.com> <40801E1B.4020401@syscor.com> <200404161210.47995.josh@agliodbs.com> <2408.1082145927@sss.pgh.pa.us> In-Reply-To: <2408.1082145927@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200404/230 X-Sequence-Number: 6530 Tom Lane wrote: >Josh Berkus writes: > > >>A better way to set this would be to run VACUUM VERBOSE ANALYZE right after >>doing one of your update batches, and see how many dead pages are being >>reclaimed, and then set max_fsm_pages to that # + 50% (or more). >> >> > >Actually, since he's running 7.4, there's an even better way. Do a >"VACUUM VERBOSE" (full-database vacuum --- doesn't matter whether you >ANALYZE or not). At the end of the very voluminous output, you'll see >something like > >INFO: free space map: 240 relations, 490 pages stored; 4080 total pages needed >DETAIL: Allocated FSM size: 1000 relations + 20000 pages = 178 kB shared memory. > >Here, I would need max_fsm_relations = 240 and max_fsm_pages = 4080 to >exactly cover the present freespace needs of my system. I concur with >the suggestion to bump that up a good deal, of course, but that gives >you a real number to start from. > >The DETAIL part of the message shows my current settings (which are the >defaults) and what the FSM is costing me in shared memory space. > > > Okay, after running the function VACUUM VERBOSE is telling me: INFO: free space map: 136 relations, 25014 pages stored; 22608 total pages needed DETAIL: Allocated FSM size: 1000 relations + 20000 pages = 178 kB shared memory. My max_fsm_pages was set to 20,000 and I reset it to 40,000 on the dev server and the function ran about 20-30% faster, so I'll try the same on the production server. Thanks for the analysis of the VACUUM info. Ron