Re: Trigram (pg_trgm) GIN index not used

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: Ivan Voras <ivoras(at)freebsd(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: Trigram (pg_trgm) GIN index not used
Date: 2013-02-21 16:27:53
Message-ID: 27614.1361464073@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Merlin Moncure <mmoncure(at)gmail(dot)com> writes:
> On Thu, Feb 21, 2013 at 9:57 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sahagian, David 2013-02-21 16:34:55 FATAL logged when starting
Previous Message Merlin Moncure 2013-02-21 16:07:25 Re: Trigram (pg_trgm) GIN index not used