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 1A2C25E48E8 for ; Sun, 5 Sep 2004 18:07:46 +0100 (BST) 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 14141-10 for ; Sun, 5 Sep 2004 17:07:43 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 23BA05E48E7 for ; Sun, 5 Sep 2004 18:07:43 +0100 (BST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i85H7iib029497; Sun, 5 Sep 2004 13:07:44 -0400 (EDT) To: Adi Alurkar Cc: pgsql-performance@postgresql.org Subject: Re: Dump/Restore performance improvement In-reply-to: <18A61C72-FEF1-11D8-8BA3-000A95C4BD7A@sf.net> References: <18A61C72-FEF1-11D8-8BA3-000A95C4BD7A@sf.net> Comments: In-reply-to Adi Alurkar message dated "Sat, 04 Sep 2004 21:07:26 -0700" Date: Sun, 05 Sep 2004 13:07:43 -0400 Message-ID: <29496.1094404063@sss.pgh.pa.us> From: Tom Lane 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: 200409/29 X-Sequence-Number: 8157 Adi Alurkar writes: > 1) Add a new config paramter e.g work_maintanence_max_mem this will > the max memory postgresql *can* claim if need be. > 2) During the dump phase of the DB postgresql estimates the > "work_maintenance_mem" that would be required to create the index in > memory(if possible) and add's a > SET work_maintenance_mem="the value calculated" (IF this value is less > than work_maintanence_max_mem. ) This seems fairly pointless to me. How is this different from just setting maintenance_work_mem as large as you can stand before importing the dump? Making any decisions at dump time seems wrong to me in the first place; pg_dump should not be expected to know what conditions the restore will be run under. I'm not sure that's what you're proposing, but I don't see what the point is in practice. It's already the case that maintenance_work_mem is treated as the maximum memory you can use, rather than what you will use even if you don't need it all. regards, tom lane