pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
To: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: Dan Ports <drkp@csail.mit.edu>
Cc: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Cc: pgsql-hackers@postgresql.org
Subject: Re: SSI bug?
Date: Thu, 31 Mar 2011 21:31:37 +0300
Message-ID: <4D94C889.3050607@enterprisedb.com> (raw)
In-Reply-To: <4D948066020000250003C00B@gw.wicourts.gov>
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>

On 31.03.2011 21:23, Kevin Grittner wrote:
> Dan Ports<drkp@csail.mit.edu>  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



view thread (71+ messages)  latest in thread

Message-ID: <4D94C889.3050607@enterprisedb.com>
Permalink:  ../4D94C889.3050607@enterprisedb.com/
Also on:    postgresql.org/message-id/4D94C889.3050607@enterprisedb.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: heikki.linnakangas@enterprisedb.com, Kevin.Grittner@wicourts.gov, drkp@csail.mit.edu, yamt@mwd.biglobe.ne.jp
  Subject: Re: SSI bug?
  In-Reply-To: <4D94C889.3050607@enterprisedb.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox