Re: [HACKERS] trgm regex index peculiarity

2014-04-05 Thread Tom Lane
Alexander Korotkov writes: > Next revision of patch is attached. Changes are so: > 1) Notion "penalty" is used instead of "size". > 2) We try to reduce total penalty to WISH_TRGM_PENALTY, but restriction is > MAX_TRGM_COUNT total trigrams count. > 3) Penalties are assigned to particular color trig

Re: [HACKERS] trgm regex index peculiarity

2014-04-05 Thread Tom Lane
"Erik Rijkers" writes: > On Fri, March 28, 2014 09:31, Heikki Linnakangas wrote: >> So thanks to the fast scan patch, I don't think this patch is worth >> pursuing anymore. Unless there are some other test case where this patch >> helps, but the fast scan patch doesn't. > FWIW, for me the differe

Re: [HACKERS] trgm regex index peculiarity

2014-03-28 Thread Erik Rijkers
On Fri, March 28, 2014 09:31, Heikki Linnakangas wrote: > I went back and tried Erik's original test > (http://www.postgresql.org/message-id/dafad644f268ce1503e1b8b682aae38a.squir...@webmail.xs4all.nl). > With a fresh checkout from master, the difference between the slow and > fast queries is much

Re: [HACKERS] trgm regex index peculiarity

2014-03-28 Thread Heikki Linnakangas
I went back and tried Erik's original test (http://www.postgresql.org/message-id/dafad644f268ce1503e1b8b682aae38a.squir...@webmail.xs4all.nl). With a fresh checkout from master, the difference between the slow and fast queries is much less dramatic than Erik reported. The reason is that Alexand

Re: [HACKERS] trgm regex index peculiarity

2014-03-01 Thread Alexander Korotkov
On Mon, Feb 10, 2014 at 1:01 AM, Tom Lane wrote: > Alexander Korotkov writes: > > On Thu, Jan 16, 2014 at 3:34 AM, Tom Lane wrote: > >> I looked at this patch a bit. It seems like this: > >> + *BLANK_COLOR_SIZE - How much blank character is more frequent > than > >> + *

Re: [HACKERS] trgm regex index peculiarity

2014-02-09 Thread Tom Lane
Alexander Korotkov writes: > On Thu, Jan 16, 2014 at 3:34 AM, Tom Lane wrote: >> I looked at this patch a bit. It seems like this: >> + *BLANK_COLOR_SIZE - How much blank character is more frequent than >> + * other character in average >> + #define BLANK_COLOR_SIZE

Re: [HACKERS] trgm regex index peculiarity

2014-02-09 Thread Alexander Korotkov
On Thu, Jan 16, 2014 at 3:34 AM, Tom Lane wrote: > Alexander Korotkov writes: > > Revised version of patch with necessary comments. > > I looked at this patch a bit. It seems like this: > > + *BLANK_COLOR_SIZE - How much blank character is more frequent than > + * ot

Re: [HACKERS] trgm regex index peculiarity

2014-01-15 Thread Tom Lane
Alexander Korotkov writes: > Revised version of patch with necessary comments. I looked at this patch a bit. It seems like this: + *BLANK_COLOR_SIZE - How much blank character is more frequent than + * other character in average + #define BLANK_COLOR_SIZE 32 is

Re: [HACKERS] trgm regex index peculiarity

2014-01-15 Thread Alexander Korotkov
On Fri, Jun 21, 2013 at 5:39 PM, Erik Rijkers wrote: > On Fri, June 21, 2013 15:11, Alexander Korotkov wrote: > > On Fri, Jun 21, 2013 at 2:40 PM, Erik Rijkers wrote: > > > >> On Fri, June 21, 2013 05:25, Tom Lane wrote: > >> > "Erik Rijkers" writes: > >> >> In a 112 MB test table (containing r

Re: [HACKERS] trgm regex index peculiarity

2013-06-21 Thread Erik Rijkers
On Fri, June 21, 2013 15:11, Alexander Korotkov wrote: > On Fri, Jun 21, 2013 at 2:40 PM, Erik Rijkers wrote: > >> On Fri, June 21, 2013 05:25, Tom Lane wrote: >> > "Erik Rijkers" writes: >> >> In a 112 MB test table (containing random generated text) with a trgm >> index (gin_trgm_ops), I consis

Re: [HACKERS] trgm regex index peculiarity

2013-06-21 Thread Alexander Korotkov
On Fri, Jun 21, 2013 at 2:40 PM, Erik Rijkers wrote: > On Fri, June 21, 2013 05:25, Tom Lane wrote: > > "Erik Rijkers" writes: > >> In a 112 MB test table (containing random generated text) with a trgm > index (gin_trgm_ops), I consistently get these > >> timings: > >> select txt from azjunk6 wh

Re: [HACKERS] trgm regex index peculiarity

2013-06-21 Thread Erik Rijkers
On Fri, June 21, 2013 05:25, Tom Lane wrote: > "Erik Rijkers" writes: >> In a 112 MB test table (containing random generated text) with a trgm index >> (gin_trgm_ops), I consistently get these >> timings: >> select txt from azjunk6 where txt ~ '^abcd'; >>130 ms >> select txt from azjunk6 >> w

Re: [HACKERS] trgm regex index peculiarity

2013-06-20 Thread Tom Lane
"Erik Rijkers" writes: > In a 112 MB test table (containing random generated text) with a trgm index > (gin_trgm_ops), I consistently get these timings: > select txt from azjunk6 where txt ~ '^abcd'; >130 ms > select txt from azjunk6 > where txt ~ 'abcd' and substr(txt,1,4) = 'abcd'; >3 m

[HACKERS] trgm regex index peculiarity

2013-06-20 Thread Erik Rijkers
9.4devel (but same in 9.3) In a 112 MB test table (containing random generated text) with a trgm index (gin_trgm_ops), I consistently get these timings: select txt from azjunk6 where txt ~ '^abcd'; 130 ms select txt from azjunk6 where txt ~ 'abcd' and substr(txt,1,4) = 'abcd'; 3 ms (a s