Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 17FE664FC1C for ; Tue, 23 Sep 2008 10:04:29 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 15900-01 for ; Tue, 23 Sep 2008 10:04:24 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outmail137074.authsmtp.com (outmail137074.authsmtp.com [62.13.137.74]) by postgresql.org (Postfix) with ESMTP id 8908664FC15 for ; Tue, 23 Sep 2008 10:04:24 -0300 (ADT) Received: from mail-c189.authsmtp.com (mail-c189.authsmtp.com [62.13.128.71]) by punt4.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id m8ND4Mlf029183; Tue, 23 Sep 2008 14:04:22 +0100 (BST) Received: from [192.168.0.3] (85-211-71-126.dyn.gotadsl.co.uk [85.211.71.126]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id m8ND4KHx019439; Tue, 23 Sep 2008 14:04:20 +0100 (BST) Subject: Re: hash index improving v3 From: Simon Riggs To: Tom Lane Cc: "Jonah H. Harris" , Alex Hunsaker , Kenneth Marshall , Xiao Meng , Zdenek Kotala , pgsql-patches@postgresql.org In-Reply-To: <25193.1222172194@sss.pgh.pa.us> References: <34d269d40809052249h59750f83v4b19a50d0555580@mail.gmail.com> <34d269d40809091823t204e252fl246443be71aed9ff@mail.gmail.com> <20080910130401.GG6714@it.is.rice.edu> <34d269d40809102049y2599a381kf409c0b5f18b6170@mail.gmail.com> <34d269d40809102117g470c4d25l55be7898fc43fc40@mail.gmail.com> <20080911152437.GM6714@it.is.rice.edu> <34d269d40809111951s7bac44cfk5dc9244693dd777c@mail.gmail.com> <20080912142921.GB26773@it.is.rice.edu> <7246.1221445012@sss.pgh.pa.us> <34d269d40809222025k2b2252dft89db471649c8eef8@mail.gmail.com> <36e682920809222030k49293e85jc57429296c5d2d76@mail.gmail.com> <17323.1222142759@sss.pgh.pa.us> <1222144262.4445.265.camel@ebony.2ndQuadrant> <18049.1222145316@sss.pgh.pa.us> <1222146936.4445.290.camel@ebony.2ndQuadrant> <25193.1222172194@sss.pgh.pa.us> Content-Type: text/plain Date: Tue, 23 Sep 2008 14:05:15 +0100 Message-Id: <1222175115.4445.344.camel@ebony.2ndQuadrant> Mime-Version: 1.0 X-Mailer: Evolution 2.12.0 Content-Transfer-Encoding: 7bit X-Server-Quench: 235decb6-8970-11dd-bc7a-001f29070be2 X-AuthRoute: OCdxZQATClZOTQEd DAteCiNZVAwpPBRK HVkIKg5MJUcNSQVJ NksacRtFagZbflxB HGQLW1xEUVl7WWd/ aQsfZQBDYEtPQQJr TklLRE1QEQdtHhxP WxZgJh0JD01GeXd0 Zk8sXHVeWAp4dkMp Fx0GE3AObGBgdWEe BBRFJVBTIR5Kfh4T aFl/U3NfNGdJBC9q VzwLFgwaHRhkHWxV SxoNZVMUTUsbVj85 XwoFAzQpEgUbHE1p X-Authentic-SMTP: 61633235383639.kestrel.dmpriest.net.uk:1374/Kp X-Report-SPAM: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-Virus-Status: No virus detected - but ensure you scan with your own anti-virus system! X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200809/154 X-Sequence-Number: 7169 On Tue, 2008-09-23 at 08:16 -0400, Tom Lane wrote: > Simon Riggs writes: > > maintenance_work_mem is already used for 3 separate operations that bear > > little resemblance to each other. If it's appropriate for all of those > > then its appropriate for this usage also. > > No, it isn't. > > The fundamental point here is that this isn't a memory allocation > parameter; it's a switchover threshold between two different behaviors. That's a little confusing since sorts switch their behaviour also, but use (some form of) work_mem, which is *also* their max allocation. I see the difficulty in understanding the algorithm's behaviour now. So shared_buffers is the wrong parameter, but even if we had a parameter it would be very difficult to set it. Thinks: Why not just sort all of the time and skip the debate entirely? I thought the main use case was for larger indexes, since that's when the number of levels in the index is significantly less than btrees? Do we need to optimise creation time of smaller hash indexes at all? -- Simon Riggs www.2ndQuadrant.com PostgreSQL Training, Services and Support