Tom Lane wrote:
> Bruce Momjian <[EMAIL PROTECTED]> writes:
> > 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.
> 
> The only thing I recall being lots worse is initial index build.
> 
> I have not tested it much, but I would expect that hash holds up better
> in the presence of many equal keys than btree does...

I remember three problems:  build time, index size, and concurrency
problems.  I was wondering about the equal key case myself, and assumed
hash may be a win there, but with the concurrency problems, is that even
possible?

OK, I have reworded it.  Is that better?  How about an elog(NOTICE) for
hash use?

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  [EMAIL PROTECTED]               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
Index: doc/src/sgml/indices.sgml
===================================================================
RCS file: /cvsroot/pgsql/doc/src/sgml/indices.sgml,v
retrieving revision 1.32
diff -c -r1.32 indices.sgml
*** doc/src/sgml/indices.sgml   21 Jun 2002 03:25:53 -0000      1.32
--- doc/src/sgml/indices.sgml   21 Jun 2002 15:00:32 -0000
***************
*** 181,188 ****
  </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.
      </para>
     </note>  
--- 181,188 ----
  </synopsis>
     <note>
      <para>
!      Testing has shown hash indexes to be similar or slower than btree indexes,
!      and the index size and build time for hash indexes is much worse. For
       these reasons, hash index use is discouraged.
      </para>
     </note>  
Index: doc/src/sgml/ref/create_index.sgml
===================================================================
RCS file: /cvsroot/pgsql/doc/src/sgml/ref/create_index.sgml,v
retrieving revision 1.32
diff -c -r1.32 create_index.sgml
*** doc/src/sgml/ref/create_index.sgml  21 Jun 2002 03:25:53 -0000      1.32
--- doc/src/sgml/ref/create_index.sgml  21 Jun 2002 15:00:32 -0000
***************
*** 330,337 ****
      the <literal>=</literal> operator.
     </para>
     <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.
     </para>
  
--- 330,337 ----
      the <literal>=</literal> operator.
     </para>
     <para>
!      Testing has shown hash indexes to be similar or slower than btree indexes,
!      and the index size and build time for hash indexes is much worse. For
       these reasons, hash index use is discouraged.
     </para>
  

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Reply via email to