Re: [HACKERS] citext like searches using index

2013-04-02 Thread David E. Wheeler
On Apr 2, 2013, at 10:16 AM, Tom Lane wrote: >> Is this knowledge encapsulated in a to-do? > > I added an item to the "Indexes" section of the TODO page. Great, thanks. David -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://

Re: [HACKERS] citext like searches using index

2013-04-02 Thread Tom Lane
"David E. Wheeler" writes: > On Apr 2, 2013, at 8:03 AM, Tom Lane wrote: >>> Are there any widely known non-built-in cases besides citext? >> Well, indxpath.c knows about text LIKE and network subset operators, >> and it would be nice if it knew how to do the same type of optimization >> for ran

Re: [HACKERS] citext like searches using index

2013-04-02 Thread David E. Wheeler
On Apr 2, 2013, at 8:03 AM, Tom Lane wrote: >> Are there any widely known non-built-in cases besides citext? > > Well, indxpath.c knows about text LIKE and network subset operators, > and it would be nice if it knew how to do the same type of optimization > for range inclusion, ie btree_indexed_

Re: [HACKERS] citext like searches using index

2013-04-02 Thread Tom Lane
Peter Eisentraut writes: > On 4/2/13 10:26 AM, Tom Lane wrote: >> The issue with the LIKE special case is that left-anchored patterns >> are (to some extent) indexable with ordinary btree indexes, and so we >> want to exploit that rather than tell people they have to have a whole >> other index.

Re: [HACKERS] citext like searches using index

2013-04-02 Thread Peter Eisentraut
On 4/2/13 10:26 AM, Tom Lane wrote: > The issue with the LIKE special case is that left-anchored patterns > are (to some extent) indexable with ordinary btree indexes, and so we > want to exploit that rather than tell people they have to have a whole > other index. In practice, you need an index s

Re: [HACKERS] citext like searches using index

2013-04-02 Thread Tom Lane
Peter Eisentraut writes: > On 3/30/13 11:35 PM, Tom Lane wrote: >> The LIKE index optimization is hard-wired into >> match_special_index_operator(), which never heard of citext's ~~ >> operators. >> >> I've wanted for years to replace that mechanism with something that >> would support plug-in ex

Re: [HACKERS] citext like searches using index

2013-04-02 Thread Peter Eisentraut
On 3/30/13 11:35 PM, Tom Lane wrote: > The LIKE index optimization is hard-wired into > match_special_index_operator(), which never heard of citext's ~~ > operators. > > I've wanted for years to replace that mechanism with something that > would support plug-in extensions, but have no very good id

Re: [HACKERS] citext like searches using index

2013-03-31 Thread Andres Freund
On 2013-03-30 23:35:24 -0400, Tom Lane wrote: > "David E. Wheeler" writes: > > Hackers, what would be required to get an index on a CITEXT column to > > support LIKE? > > The LIKE index optimization is hard-wired into > match_special_index_operator(), which never heard of citext's ~~ > operators

Re: [HACKERS] citext like searches using index

2013-03-30 Thread Tom Lane
"David E. Wheeler" writes: > Hackers, what would be required to get an index on a CITEXT column to support > LIKE? The LIKE index optimization is hard-wired into match_special_index_operator(), which never heard of citext's ~~ operators. I've wanted for years to replace that mechanism with some

Re: [HACKERS] citext like searches using index

2013-03-30 Thread David E. Wheeler
On Mar 20, 2013, at 1:45 AM, David E. Wheeler wrote: >> Is there currently any way to create an index that can be used to speed up >> searches like the one above? >> If not, do you have any idea how it might be implemented? Perhaps I could >> give it a try myself. >> >> Thank you in advance fo

Re: [HACKERS] citext like searches using index

2013-03-19 Thread David E. Wheeler
On Mar 17, 2013, at 6:35 AM, Thorbjørn Weidemann wrote: > Hi David, > > I found your email-address on > http://www.postgresql.org/docs/9.2/static/citext.html. I hope it's ok to > contact you this way. > I would like to thank you for taking the time to make citext available for > Postgres, an