X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 49EC15283A for ; Fri, 27 May 2005 19:07:46 -0300 (ADT) 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 31288-07 for ; Fri, 27 May 2005 22:07:37 +0000 (GMT) Received: from candle.pha.pa.us (candle.pha.pa.us [64.139.89.126]) by svr1.postgresql.org (Postfix) with ESMTP id 17E3152800 for ; Fri, 27 May 2005 19:07:36 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id j4RM7cP26096; Fri, 27 May 2005 18:07:38 -0400 (EDT) From: Bruce Momjian Message-Id: <200505272207.j4RM7cP26096@candle.pha.pa.us> Subject: Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL In-Reply-To: <42816A7E.3080508@samurai.com> To: Neil Conway Date: Fri, 27 May 2005 18:07:38 -0400 (EDT) Cc: Mischa Sandberg , pgsql-general@postgresql.org X-Mailer: ELM [version 2.4ME+ PL121 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.01 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200505/1262 X-Sequence-Number: 78610 Added to TODO: * Consider sorting hash buckets so entries can be found using a binary search, rather than a linear scan * In hash indexes, consider storing the hash value with or instead of the key itself --------------------------------------------------------------------------- Neil Conway wrote: > Bruce Momjian wrote: > > Is there a TODO anywhere in this discussion? If so, please let me know. > > There are a couple: > > - consider changing hash indexes to keep the entries in a hash bucket > sorted, to allow a binary search rather than a linear scan > > - consider changing hash indexes to store each key's hash value in > addition to or instead of the key value. > > You should probably include a pointer to this discussion as well. > > (I'd like to take a look at implementing these if I get a chance.) > > -Neil > -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073