Re: [HACKERS] trgm regex index peculiarity

2014-04-05 Thread Tom Lane
Erik Rijkers e...@xs4all.nl 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

Re: [HACKERS] trgm regex index peculiarity

2014-04-05 Thread Tom Lane
Alexander Korotkov aekorot...@gmail.com 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

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

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-01 Thread Alexander Korotkov
On Mon, Feb 10, 2014 at 1:01 AM, Tom Lane t...@sss.pgh.pa.us wrote: Alexander Korotkov aekorot...@gmail.com writes: On Thu, Jan 16, 2014 at 3:34 AM, Tom Lane t...@sss.pgh.pa.us wrote: I looked at this patch a bit. It seems like this: + *BLANK_COLOR_SIZE - How much blank character is

Re: [HACKERS] trgm regex index peculiarity

2014-02-09 Thread Alexander Korotkov
On Thu, Jan 16, 2014 at 3:34 AM, Tom Lane t...@sss.pgh.pa.us wrote: Alexander Korotkov aekorot...@gmail.com 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

Re: [HACKERS] trgm regex index peculiarity

2014-02-09 Thread Tom Lane
Alexander Korotkov aekorot...@gmail.com writes: On Thu, Jan 16, 2014 at 3:34 AM, Tom Lane t...@sss.pgh.pa.us 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

Re: [HACKERS] trgm regex index peculiarity

2014-01-15 Thread Alexander Korotkov
On Fri, Jun 21, 2013 at 5:39 PM, Erik Rijkers e...@xs4all.nl wrote: On Fri, June 21, 2013 15:11, Alexander Korotkov wrote: On Fri, Jun 21, 2013 at 2:40 PM, Erik Rijkers e...@xs4all.nl wrote: On Fri, June 21, 2013 05:25, Tom Lane wrote: Erik Rijkers e...@xs4all.nl writes: In a 112 MB

Re: [HACKERS] trgm regex index peculiarity

2014-01-15 Thread Tom Lane
Alexander Korotkov aekorot...@gmail.com 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

Re: [HACKERS] trgm regex index peculiarity

2013-06-21 Thread Erik Rijkers
On Fri, June 21, 2013 05:25, Tom Lane wrote: Erik Rijkers e...@xs4all.nl 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

Re: [HACKERS] trgm regex index peculiarity

2013-06-21 Thread Alexander Korotkov
On Fri, Jun 21, 2013 at 2:40 PM, Erik Rijkers e...@xs4all.nl wrote: On Fri, June 21, 2013 05:25, Tom Lane wrote: Erik Rijkers e...@xs4all.nl 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

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 e...@xs4all.nl wrote: On Fri, June 21, 2013 05:25, Tom Lane wrote: Erik Rijkers e...@xs4all.nl writes: In a 112 MB test table (containing random generated text) with a trgm index

[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

Re: [HACKERS] trgm regex index peculiarity

2013-06-20 Thread Tom Lane
Erik Rijkers e...@xs4all.nl 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';