Re: [HACKERS] wildcard search support for pg_trgm

2011-02-01 Thread Alexander Korotkov
On Tue, Feb 1, 2011 at 5:40 AM, Tom Lane wrote: > AFAICT that would break on-disk compatibility of pg_trgm GIST indexes. > I don't believe we have adequate evidence to justify doing that, and > in any case it ought to be a separate patch rather than buried inside a > mostly unrelated feature patc

Re: [HACKERS] wildcard search support for pg_trgm

2011-01-31 Thread Tom Lane
=?UTF-8?B?SmFuIFVyYmHFhHNraQ==?= writes: > OK, now it works flawlessly as far as I can tell. Will mark it as Ready > for Committer. Applied with mostly-stylistic corrections, plus addition of documentation and a minimal regression test. I did *not* apply this bit: >> 2) I found gist index not v

Re: [HACKERS] wildcard search support for pg_trgm

2011-01-30 Thread Jan Urbański
On 30/01/11 23:04, Jan Urbański wrote: > On 30/01/11 23:02, Alexander Korotkov wrote: >> Hi! >> >> On Mon, Jan 31, 2011 at 12:52 AM, Jan Urbański > > wrote: >> >> I saw that the code tries to handle ILIKE searches, but apparently it's >> failing somewhere. >> >>

Re: [HACKERS] wildcard search support for pg_trgm

2011-01-30 Thread Jan Urbański
On 30/01/11 23:02, Alexander Korotkov wrote: > Hi! > > On Mon, Jan 31, 2011 at 12:52 AM, Jan Urbański > wrote: > > I saw that the code tries to handle ILIKE searches, but apparently it's > failing somewhere. > > It was just a typo. Corrected version attached.

Re: [HACKERS] wildcard search support for pg_trgm

2011-01-30 Thread Alexander Korotkov
Hi! On Mon, Jan 31, 2011 at 12:52 AM, Jan Urbański wrote: > I saw that the code tries to handle ILIKE searches, but apparently it's > failing somewhere. > It was just a typo. Corrected version attached. With best regards, Alexander Korotkov. *** a/contrib/pg_trgm/pg_trgm.sql.in --- b/contr

Re: [HACKERS] wildcard search support for pg_trgm

2011-01-30 Thread Jan Urbański
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 i

Re: [HACKERS] wildcard search support for pg_trgm

2011-01-29 Thread Alexander Korotkov
Hello! 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. Some notes abount gin interface functions. Extract query and extract value functions was separated, because with wildcard search these

Re: [HACKERS] wildcard search support for pg_trgm

2011-01-24 Thread Tom Lane
Jesper Krogh writes: > Would it be hard to make it support "n-grams" (e.g. making the length > configurable) instead of trigrams? That would be a complete rewrite with an incompatible on-disk index representation, which seems a bit beyond the scope of this patch. regards,

Re: [HACKERS] wildcard search support for pg_trgm

2011-01-24 Thread Jesper Krogh
On 2011-01-24 16:34, Alexander Korotkov wrote: Hi! On Mon, Jan 24, 2011 at 3:07 AM, Jan Urbański wrote: I see two issues with this patch. First of them is the resulting index size. I created a table with 5 copies of /usr/share/dict/american-english in it and a gin index on it, using gin_trgm_

Re: [HACKERS] wildcard search support for pg_trgm

2011-01-24 Thread Alexander Korotkov
Hi! On Mon, Jan 24, 2011 at 3:07 AM, Jan Urbański wrote: > I see two issues with this patch. First of them is the resulting index > size. I created a table with 5 copies of > /usr/share/dict/american-english in it and a gin index on it, using > gin_trgm_ops. The results were: > > * relation siz

[HACKERS] wildcard search support for pg_trgm

2011-01-23 Thread Jan Urbański
Hi, I tested the patch from http://archives.postgresql.org/message-id/aanlktikvxx6_ajzb52ona7mbzijcpdqszomcd-3u1...@mail.gmail.com which adds GIN and GIST index support for wildcard LIKE queries using pg_trgm. The patch is a context diff that applies cleanly. Regression test work after applying i

Re: [HACKERS] Wildcard search support for pg_trgm

2011-01-17 Thread Alexander Korotkov
Hi, Here is updated version of this patch. With best regards, Alexander Korotkov. *** a/contrib/pg_trgm/pg_trgm.sql.in --- b/contrib/pg_trgm/pg_trgm.sql.in *** *** 113,118 FOR TYPE text USING gist --- 113,120 AS OPERATOR1 % (text, text),

Re: [HACKERS] Wildcard search support for pg_trgm

2011-01-14 Thread Jan Urbański
On 08/01/11 23:37, Alexander Korotkov wrote: > I updated my patch to make it use full index scan in GIN index which is > possible thanks to recent Tom Lane patch. Now wildcard, where no trigram can > be extracted from, invokes full index scan, which is slow but correct. Hi, unfortunately, this ch

Re: [HACKERS] Wildcard search support for pg_trgm

2011-01-08 Thread Alexander Korotkov
I updated my patch to make it use full index scan in GIN index which is possible thanks to recent Tom Lane patch. Now wildcard, where no trigram can be extracted from, invokes full index scan, which is slow but correct. test=# explain (analyze, buffers) select * from words where word ilike '%in%';

Re: [HACKERS] Wildcard search support for pg_trgm

2010-12-12 Thread Alexander Korotkov
On Mon, Dec 13, 2010 at 12:14 AM, Dimitri Fontaine wrote: > How different (and better) is it from wildspeed? > The general advantage is possibility of usage wildcard search and trigram similarity search using the same index. I expect that GIN trigram index is slightly less space demanding, but sl

Re: [HACKERS] Wildcard search support for pg_trgm

2010-12-12 Thread Dimitri Fontaine
Alexander Korotkov writes: > Here is first version of patch, which enable index support of wildcard > search in pg_trgm contrib module. How different (and better) is it from wildspeed? http://www.sai.msu.su/~megera/wiki/wildspeed Regards, -- Dimitri Fontaine http://2ndQuadrant.fr Postgre

Re: [HACKERS] Wildcard search support for pg_trgm

2010-12-12 Thread Alexander Korotkov
I found another problem. GIN index suffers from "GIN indexes do not support whole-index scans" when no trigram can be extracted from pattern. With best regards, Alexander Korotkov.

[HACKERS] Wildcard search support for pg_trgm

2010-12-11 Thread Alexander Korotkov
Hackers, Here is first version of patch, which enable index support of wildcard search in pg_trgm contrib module. The idea of the patch is to extract from wildcard trigrams which should occurs in wildcard matching string. For example, for '%sector%' wildcard such trigrams would be: 'sec', 'ect', '