Re: What is wrong with hashed index usage?

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Neil Conway <nconway(at)klamath(dot)dyndns(dot)org>, mloftis(at)wgops(dot)com, DCorbit(at)connx(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: What is wrong with hashed index usage?
Date: 2002-06-21 13:32:19
Message-ID: 200206211332.g5LDWJY10224@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > <para>
> > ! Because of the limited utility of hash indexes, a B-tree index
> > ! should generally be preferred over a hash index. We do not have
> > ! sufficient evidence that hash indexes are actually faster than
> > ! B-trees even for <literal>=</literal> comparisons. Moreover,
> > ! hash indexes require coarser locks; see <xref
> > ! linkend="locking-indexes">.
> > </para>
> > </note>
> > </para>
> > --- 181,189 ----
> > </synopsis>
> > <note>
> > <para>
> > ! Testing has shown that hash indexes are slower than btree indexes,
> > ! and the size and build time for hash indexes is much worse. For
> > ! these reasons, hash index use is discouraged.
>
> This change strikes me as a step backwards. The existing wording tells
> the truth; the proposed revision removes the facts in favor of a blanket
> assertion that is demonstrably false.

OK, which part of is "demonstrably false"? I think the old "should
generally be preferred" is too vague. No one has come up with a case
where hash has shown to be faster, and a lot of cases where it is slower.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-06-21 13:39:15 Re: Idea for the statistics collector
Previous Message Tom Lane 2002-06-21 13:25:38 Re: What is wrong with hashed index usage?