index type for indexing long texts - Mailing list pgsql-general

From Aleksander Kmetec
Subject index type for indexing long texts
Date
Msg-id 45A8F0F6.3050904@intera.si
Whole thread Raw
Responses Re: index type for indexing long texts  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
(I'm reposting this because the original message didn't make it through in the last ~20 hours)

Hi,

I'm looking for a solution for indexing long TEXT columns. We're currently using a HASH index, which can handle most
situations, but every now and then we need support for even longer texts.

One solution would be to create a functional index which would only use the first N chars of mycol, but then we'd have
to change several hundred occurences of "mycol = someval" with "(mycol = someval AND firstN(mycol) = firstN(someval))",

as well as update some SQL generators...

That's why I'd be interested to know if there are any index types available which store only the first N chars or use
some highly compressed form for storing index data, and then recheck any potential hits against the main table. And if
something like that does not exist yet, how difficult would it be to construct such a solution out of many "spare
parts" 
that come with PG?

All we really need is index support for the "=" operator; everything else is optional.
We're currently using PG 8.1.

I'd be grateful for any suggestions.

Regards,
Aleksander

pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: FK Constraint on index not PK
Next
From: Jeff Amiel
Date:
Subject: Re: Corrupt database? 8.1/FreeBSD6.0