Re: todo: Hash index creation

From: Hannu Krosing <hannu(at)skype(dot)net>
To: Naz Gassiep <naz(at)mira(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: todo: Hash index creation
Date: 2007-07-02 08:52:57
Message-ID: 1183366377.6370.4.camel@hannu-laptop
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ühel kenal päeval, E, 2007-07-02 kell 04:27, kirjutas Naz Gassiep:

> I've been warned away from hash indexes before, however I had no idea
> that it's performance was that abysmal that BTREE beat it and I was
> definitely not aware that they were not included in WAL logs. I was told
> it wasn't as good as it could be, but I wasn't told it was pretty much
> an alpha piece of code.
>
> As a result, when creating tables containing large blocks of text I wish
> to index, I've been using HASH as an index method.

If you just wish to have smaller indexes, then you can use functional
btree indexes over text hash, like this:

CREATE INDEX largetextindex on mytable(hashtext(largetext));

and use

SELECT * FROM mytable
where hashtext(largetext) = hastext('searchvalue')
and largetext = 'searchvalue'
;

btw, if the real hash indexes don't get fixes soon, maybe we could
redefine hash index to actually mean usage like this and do the rewrites
in parser?

> Please can we state
> in the manual that HASH index types are in a beta stage of development
> or something similar, or perhaps remove the manual entry altogether
> until HASH is at a point where it is usable in production.
>
> Regards,
> A very surprised n00b.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Manera, Villiam 2007-07-02 09:50:28 R: R: [postgresql-it] no cascade triggers?
Previous Message Pavel Stehule 2007-07-02 05:09:16 Re: what is difference between LOCAL and GLOBAL TEMP TABLES in PostgreSQL