Re: Trigram (pg_trgm) GIN index not used - Mailing list pgsql-general

From Tom Lane
Subject Re: Trigram (pg_trgm) GIN index not used
Date
Msg-id 27614.1361464073@sss.pgh.pa.us
Whole thread Raw
In response to Re: Trigram (pg_trgm) GIN index not used  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-general
Merlin Moncure <mmoncure@gmail.com> writes:
> On Thu, Feb 21, 2013 at 9:57 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I wonder whether we really need that citext-specific operator at all
>> ... but in the meantime, if you need the column to be citext for some
>> other reason, I'd suggest making a gin index on raw_data::text and
>> then writing the query as raw_data::text ilike '%zagreb%'.

> hm, one more data point that citext implementation didn't succeed in
> terms of abstracting you from case sensitivity issues.

I think this is just a bug and not a fundamental design flaw: it looks
to me like simply removing the citext-specific declarations of the regex
operators would fix the problem (because then it'd fall back on the
standard operators with an implicit cast to text, and that would match
the index).  Might cause a problem though for anybody who's got those
operators embedded in views.

            regards, tom lane

pgsql-general by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: Trigram (pg_trgm) GIN index not used
Next
From: "Sahagian, David"
Date:
Subject: FATAL logged when starting