Re: [HACKERS] Behavior of a pg_trgm index for 2 (or < 3) character LIKE queries

2013-05-31 Thread Alexander Korotkov
On Fri, May 31, 2013 at 9:41 PM, Amit Langote wrote: > On Sat, Jun 1, 2013 at 1:48 AM, Sawada Masahiko > wrote: > > On Fri, May 31, 2013 at 11:16 AM, Amit Langote > wrote: > >> 2) And if that is so, is there problem in gin_extract_query_trgm(), > >> that is while generating trigrams from a query

Re: [HACKERS] Behavior of a pg_trgm index for 2 (or < 3) character LIKE queries

2013-05-31 Thread Amit Langote
On Sat, Jun 1, 2013 at 1:48 AM, Sawada Masahiko wrote: > On Fri, May 31, 2013 at 11:16 AM, Amit Langote > wrote: >> 2) And if that is so, is there problem in gin_extract_query_trgm(), >> that is while generating trigrams from a query search term that causes >> trigrams (stored in the index if an

Re: [HACKERS] Behavior of a pg_trgm index for 2 (or < 3) character LIKE queries

2013-05-31 Thread Sawada Masahiko
On Fri, May 31, 2013 at 11:16 AM, Amit Langote wrote: > On Fri, May 31, 2013 at 4:25 AM, Alexander Korotkov > wrote: >> On Thu, May 30, 2013 at 12:49 PM, Sawada Masahiko >> wrote: >>> >>> following emails are discussed about partial match of pg_trgm. I hope >>> will this help. >>> >>>

Re: [HACKERS] Behavior of a pg_trgm index for 2 (or < 3) character LIKE queries

2013-05-30 Thread Amit Langote
On Fri, May 31, 2013 at 4:25 AM, Alexander Korotkov wrote: > On Thu, May 30, 2013 at 12:49 PM, Sawada Masahiko > wrote: >> >> following emails are discussed about partial match of pg_trgm. I hope >> will this help. >> >>

Re: [HACKERS] Behavior of a pg_trgm index for 2 (or < 3) character LIKE queries

2013-05-30 Thread Amit Langote
On Fri, May 31, 2013 at 4:25 AM, Alexander Korotkov wrote: > On Thu, May 30, 2013 at 12:49 PM, Sawada Masahiko > wrote: >> >> following emails are discussed about partial match of pg_trgm. I hope >> will this help. >> >>

Re: [HACKERS] Behavior of a pg_trgm index for 2 (or < 3) character LIKE queries

2013-05-30 Thread Alexander Korotkov
On Thu, May 30, 2013 at 12:49 PM, Sawada Masahiko wrote: > following emails are discussed about partial match of pg_trgm. I hope > will this help. > < > http://www.postgresql.org/message-id/cahgqgwfjshvv2ngme19wdtw9tefw_w7h2ns4e+yysjkb9wd...@mail.gmail.com > > > as you may know, if search string

Re: [HACKERS] Behavior of a pg_trgm index for 2 (or < 3) character LIKE queries

2013-05-30 Thread Sawada Masahiko
2013/5/31 Amit Langote > > On Thu, May 30, 2013 at 11:47 PM, Robert Haas wrote: > > On Wed, May 29, 2013 at 10:51 PM, Amit Langote > > wrote: > >> So, it appears, for search strings consisting of 2 (or < 3) > >> characters, trigrams can not be utilized. No? > > > > I think that's right. "trigr

Re: [HACKERS] Behavior of a pg_trgm index for 2 (or < 3) character LIKE queries

2013-05-30 Thread Robert Haas
On Thu, May 30, 2013 at 11:00 AM, Amit Langote wrote: > Was there any improvement to pg_trgm in recent past that could make it > better for partial matching (the case in question I suppose) or is > partial-matching a different thing altogether? Sorry, I am not sure. -- Robert Haas EnterpriseDB:

Re: [HACKERS] Behavior of a pg_trgm index for 2 (or < 3) character LIKE queries

2013-05-30 Thread Amit Langote
On Thu, May 30, 2013 at 11:47 PM, Robert Haas wrote: > On Wed, May 29, 2013 at 10:51 PM, Amit Langote > wrote: >> So, it appears, for search strings consisting of 2 (or < 3) >> characters, trigrams can not be utilized. No? > > I think that's right. "trigram" means a sequence of three characters

Re: [HACKERS] Behavior of a pg_trgm index for 2 (or < 3) character LIKE queries

2013-05-30 Thread Robert Haas
On Wed, May 29, 2013 at 10:51 PM, Amit Langote wrote: > So, it appears, for search strings consisting of 2 (or < 3) > characters, trigrams can not be utilized. No? I think that's right. "trigram" means a sequence of three characters, and what's stored in the indexes are three-character sequences

[HACKERS] Behavior of a pg_trgm index for 2 (or < 3) character LIKE queries

2013-05-29 Thread Amit Langote
Hello, I have been trying to understand how pg_trgm works. As part of that, I was looking at gin_extract_query_trgm(), which I think, extracts trigrams from a search query string. So, I debugged for 3 cases: 1) column_name LIKE '%緊急%' in this case, inside gin_extract_query_trgm(), after a call t