Re: Prefix operator for text and spgist support

2018-04-16 Thread Ildus Kurbangaliev
On Mon, 16 Apr 2018 12:45:23 +0200 Emre Hasegeli wrote: > > Thank you, pushed with some editorization and renaming > > text_startswith to starts_with > > I am sorry for not noticing this before, but what is the point of this > operator? It seems to me we are only making the prefix searching >

Re: Prefix operator for text and spgist support

2018-04-16 Thread Emre Hasegeli
> Thank you, pushed with some editorization and renaming text_startswith to > starts_with I am sorry for not noticing this before, but what is the point of this operator? It seems to me we are only making the prefix searching business, which is already complicated, more complicated. Also, the ne

Re: Prefix operator for text and spgist support

2018-04-03 Thread Teodor Sigaev
Thank you, pushed with some editorization and renaming text_startswith to starts_with Ildus Kurbangaliev wrote: On Fri, 23 Mar 2018 11:45:33 +0300 Alexander Korotkov wrote: On Thu, Mar 22, 2018 at 7:09 PM, Teodor Sigaev wrote: Patch looks resonable, but I see some place to improvement: sp

Re: Prefix operator for text and spgist support

2018-03-29 Thread Ildus Kurbangaliev
On Fri, 23 Mar 2018 11:45:33 +0300 Alexander Korotkov wrote: > On Thu, Mar 22, 2018 at 7:09 PM, Teodor Sigaev > wrote: > > > Patch looks resonable, but I see some place to improvement: > > spg_text_leaf_consistent() only needs to check with > > text_startswith() if reconstucted value came to le

Re: Prefix operator for text and spgist support

2018-03-23 Thread Alexander Korotkov
On Thu, Mar 22, 2018 at 7:09 PM, Teodor Sigaev wrote: > Patch looks resonable, but I see some place to improvement: > spg_text_leaf_consistent() only needs to check with text_startswith() if > reconstucted value came to leaf consistent is shorter than given prefix. > For example, if level >= leng

Re: Prefix operator for text and spgist support

2018-03-22 Thread Teodor Sigaev
Hi! Patch looks resonable, but I see some place to improvement: spg_text_leaf_consistent() only needs to check with text_startswith() if reconstucted value came to leaf consistent is shorter than given prefix. For example, if level >= length of prefix then we guarantee that fully reconstracted

Re: Prefix operator for text and spgist support

2018-03-12 Thread Ildus Kurbangaliev
On Tue, 6 Mar 2018 19:27:21 +0300 Arthur Zakirov wrote: > On Mon, Feb 19, 2018 at 05:19:15PM +0300, Ildus Kurbangaliev wrote: > > At brief look at this place seems better to move this block into > > pattern_fixed_prefix function. But there is also `vartype` variable > > which used to in prefix co

Re: Prefix operator for text and spgist support

2018-03-06 Thread Arthur Zakirov
On Mon, Feb 19, 2018 at 05:19:15PM +0300, Ildus Kurbangaliev wrote: > At brief look at this place seems better to move this block into > pattern_fixed_prefix function. But there is also `vartype` variable > which used to in prefix construction, and it would require pass this > variable too. And sin

Re: Prefix operator for text and spgist support

2018-02-19 Thread Ildus Kurbangaliev
On Mon, 19 Feb 2018 15:06:51 +0300 Arthur Zakirov wrote: > Hello, > > On Fri, Feb 02, 2018 at 06:03:27PM +0300, Ildus Kurbangaliev wrote: > > Hi, > > > > Attached patch introduces prefix operator ^@ for text type. For 'a > > ^@ b' it returns true if 'a' starts with 'b'. Also there is spgist > >

Re: Prefix operator for text and spgist support

2018-02-19 Thread Arthur Zakirov
Hello, On Fri, Feb 02, 2018 at 06:03:27PM +0300, Ildus Kurbangaliev wrote: > Hi, > > Attached patch introduces prefix operator ^@ for text type. For 'a ^@ b' > it returns true if 'a' starts with 'b'. Also there is spgist index > support for this operator. > > It could be useful as an alternative

Prefix operator for text and spgist support

2018-02-02 Thread Ildus Kurbangaliev
Hi, Attached patch introduces prefix operator ^@ for text type. For 'a ^@ b' it returns true if 'a' starts with 'b'. Also there is spgist index support for this operator. It could be useful as an alternative for LIKE for 'something%' templates. Or even used in LIKE queries instead of ~>=~ and ~<~