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 t...@sss.pgh.pa.us 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

Re: [HACKERS] wildcard search support for pg_trgm

2011-01-31 Thread Tom Lane
=?UTF-8?B?SmFuIFVyYmHFhHNraQ==?= wulc...@wulczer.org 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

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 in

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 wulc...@wulczer.org 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. ***

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 wulc...@wulczer.org mailto:wulc...@wulczer.org wrote: I saw that the code tries to handle ILIKE searches, but apparently it's failing somewhere. It was just a typo. Corrected version

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 wulc...@wulczer.org mailto:wulc...@wulczer.org 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-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

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 wulc...@wulczer.org 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:

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ńskiwulc...@wulczer.org 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

Re: [HACKERS] wildcard search support for pg_trgm

2011-01-24 Thread Tom Lane
Jesper Krogh jes...@krogh.cc 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.

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

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

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.

Re: [HACKERS] Wildcard search support for pg_trgm

2010-12-12 Thread Dimitri Fontaine
Alexander Korotkov aekorot...@gmail.com 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

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 dimi...@2ndquadrant.frwrote: 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