type of index?

From: Neil Conway <nconway(at)klamath(dot)dyndns(dot)org>
To: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: type of index?
Date: 2000-12-05 02:29:03
Message-ID: 20001204212903.C1186@klamath.dyndns.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm wondering about the types of indexes available. I have an indexed
column in a table which will ONLY be used with the '=' operator - in
other words:

SELECT foo FROM bar WHERE this_col = 1234;

Should the index on this_col be a btree or a hash index? By default, it
seems like Postgres is creating a btree index. But according to the
PgSQL docs, a hash index could also be used. Which would result in
better performance? Also, I've read in the list archives that
btree indexes are much better, in general, than the others. Given this,
which index is the best? Is there some of rule of thumb I can use
to decide for this and other cases?

Thanks in advance,

Neil

--
Neil Conway <neilconway(at)home(dot)com>
Get my GnuPG key from: http://klamath.dyndns.org/mykey.asc
Encrypted mail welcomed

In every country and every age, the priest has been hostile to liberty.
He is always in alliance with the despot ... they have perverted the
purest religion ever preached to man into mystery and jargon,
unintelligible to all mankind, and therfore the safer engine for
their purpose.
-- Thomas Jefferson

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tim Kientzle 2000-12-05 04:26:12 Re: Why PostgreSQL is not that popular as MySQL?
Previous Message rob 2000-12-05 00:31:56 Re: Re: Why PostgreSQL is not that popular as MySQL?