Re: wildcard search support for pg_trgm - Mailing list pgsql-hackers

From Jan Urbański
Subject Re: wildcard search support for pg_trgm
Date
Msg-id 4D45DD9B.5090003@wulczer.org
Whole thread Raw
In response to Re: wildcard search support for pg_trgm  (Alexander Korotkov <aekorotkov@gmail.com>)
Responses Re: wildcard search support for pg_trgm  (Alexander Korotkov <aekorotkov@gmail.com>)
List pgsql-hackers
On 29/01/11 13:07, Alexander Korotkov wrote:
> Hello!

Hi!

> 
> New version of patch is in the attachment. Some comments was added in
> this version. Likely these comments need significant correction because
> of my english.

Ooh, ok, the comments now helped me understand what's exactly going on
in there.

I played with it a bit more and the idea of using trigrams to do LIKE
searches is quite clever.

Unfortunately, I think there's a problem with case insensitive queries:

create table test(t text);
insert into test values ('abcdef');
create index trgm_idx_gin on test using gin (t gin_trgm_ops);
set enable_seqscan to off; -- force index usage
select * from test where t ilike '%BCD%';
-- no results!
set enable_seqscan to on; -- do not use the index
select * from test where t ilike '%BCD%';
-- the row is returned

I saw that the code tries to handle ILIKE searches, but apparently it's
failing somewhere.

I'm sorry but I'm leaving on vacation for the next week and won't be
able to continue reviewing your patch, I'll unset myself as its
reviewer, and in the meantime I hope someone else will pick it up, as
the functionality seems very interesting.

Cheers,
Jan


pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: WIP: RangeTypes
Next
From: "Kevin Grittner"
Date:
Subject: Re: SSI patch version 14