Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL

From: Jim C. Nasby
Subject: Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL
Date: ,
Msg-id: 20050510153927.GB31103@decibel.org
(view: Whole thread, Raw)
In response to: Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  (Tom Lane)
Responses: Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  (Tom Lane)
List: pgsql-general

Tree view

"Hash index" vs. "b-tree index" (PostgreSQL 8.0)  (Ying Lu, )
 Re: "Hash index" vs. "b-tree index" (PostgreSQL 8.0)  (Neil Conway, )
  Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL 8.0)  (Christopher Petrilli, )
   Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  (Neil Conway, )
    Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  ("Jim C. Nasby", )
     Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  (Neil Conway, )
      Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  ("Jim C. Nasby", )
       Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  (Neil Conway, )
        Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  (Tom Lane, )
         Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  (Neil Conway, )
          Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  (Tom Lane, )
           Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  (Neil Conway, )
           Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  (Greg Stark, )
            Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  (Tom Lane, )
             Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  (Greg Stark, )
              Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  (Tom Lane, )
               Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  (Greg Stark, )
                Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  (Tom Lane, )
         Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  ("Jim C. Nasby", )
          Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  (Tom Lane, )
           Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  ("Jim C. Nasby", )
        Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  ("Jim C. Nasby", )
         Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  (Tom Lane, )
         Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  (Mischa Sandberg, )
          Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  (Mark Lewis, )
           Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  (Mischa Sandberg, )
            Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  (Bruce Momjian, )
             Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  (Mischa Sandberg, )
              Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  (Bruce Momjian, )
               Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  (Mischa Sandberg, )
             Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  (Neil Conway, )
              Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  (Bruce Momjian, )
          Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  (Tom Lane, )
           Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  (Mischa Sandberg, )
       Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  (Bruce Momjian, )
 Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  (Tom Lane, )
  Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  (Neil Conway, )
 Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL  (Greg Stark, )

On Tue, May 10, 2005 at 12:10:57AM -0400, Tom Lane wrote:
> be responsive to your search.)  (This also brings up the thought that
> it might be interesting to support hash buckets smaller than a page ...
> but I don't know how to make that work in an adaptive fashion.)

IIRC, other databases that support hash indexes also allow you to define
the bucket size, so it might be a good start to allow for that. DBA's
usually have a pretty good idea of what a table will look like in
production, so if there's clear documentation on the effect of bucket
size a good DBA should be able to make a good decision.

What's the challange to making it adaptive, comming up with an algorithm
that gives you the optimal bucket size (which I would think there's
research on...) or allowing the index to accommodate different bucket
sizes existing in the index at once? (Presumably you don't want to
re-write the entire index every time it looks like a different bucket
size would help.)
--
Jim C. Nasby, Database Consultant               
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"


pgsql-general by date:

From: Mischa Sandberg
Date:
Subject: Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL
From: Tony Caduto
Date:
Subject: Re: Delphi - Developers start develop Access components