Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 101711337B2F for ; Thu, 31 Mar 2011 15:38:57 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 86404-10 for ; Thu, 31 Mar 2011 18:38:38 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og127.obsmtp.com (exprod7og127.obsmtp.com [64.18.2.210]) by mail.postgresql.org (Postfix) with ESMTP id D62CF13364DE for ; Thu, 31 Mar 2011 15:38:37 -0300 (ADT) Received: from source ([209.85.215.48]) (using TLSv1) by exprod7ob127.postini.com ([64.18.6.12]) with SMTP ID DSNKTZTKKzzirn95i4XA/NWgKlRCdkYZmH3E@postini.com; Thu, 31 Mar 2011 11:38:38 PDT Received: by ewy22 with SMTP id 22so1070796ewy.21 for ; Thu, 31 Mar 2011 11:38:34 -0700 (PDT) Received: by 10.213.23.91 with SMTP id q27mr1262155ebb.68.1301596301944; Thu, 31 Mar 2011 11:31:41 -0700 (PDT) Received: from [192.168.1.183] (dsl-hkibrasgw2-ff7ac300-240.dhcp.inet.fi [88.195.122.240]) by mx.google.com with ESMTPS id q53sm894624eeh.11.2011.03.31.11.31.39 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 31 Mar 2011 11:31:40 -0700 (PDT) Message-ID: <4D94C889.3050607@enterprisedb.com> Date: Thu, 31 Mar 2011 21:31:37 +0300 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; fi-FI; rv:1.9.1.16) Gecko/20110307 Icedove/3.0.11 MIME-Version: 1.0 To: Kevin Grittner CC: Dan Ports , YAMAMOTO Takashi , pgsql-hackers@postgresql.org Subject: Re: SSI bug? References: <4D8F54E6020000250003BD16@gw.wicourts.gov> <4D8F54E6020000250003BD16@gw.wicourts.gov> <20110328031616.CDAA719CEDF@mail.netbsd.org> <4D943BEC020000250003BFDA@gw.wicourts.gov> <4D94A2BB.3090605@enterprisedb.com> <4D946036020000250003BFFC@gw.wicourts.gov> <20110331181216.GF81592@csail.mit.edu> <4D948066020000250003C00B@gw.wicourts.gov> In-Reply-To: <4D948066020000250003C00B@gw.wicourts.gov> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201103/1911 X-Sequence-Number: 185161 On 31.03.2011 21:23, Kevin Grittner wrote: > Dan Ports wrote: >> On Thu, Mar 31, 2011 at 11:06:30AM -0500, Kevin Grittner wrote: >>> The only thing I've been on the fence about is whether it >>> makes more sense to allocate it all up front or to continue to > allow >>> incremental allocation but set a hard limit on the number of > entries >>> allocated for each shared memory HTAB. Is there a performance- >>> related reason to choose one path or the other? >> >> Seems like it would be marginally better to allocate it up front -- > then >> you don't have the cost of having to split buckets later as it > grows. > > The attached patch should cover that. That's not enough. The hash tables can grow beyond the maximum size you specify in ShmemInitHash. It's just a hint to size the directory within the hash table. We'll need to teach dynahash not to allocate any more entries after the preallocation. A new HASH_NO_GROW flag to hash_create() seems like a suitable interface. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com