Re: [GENERAL] String searching

2014-11-18 Thread Albe Laurenz
Jonathan Vanasco wrote: On Nov 17, 2014, at 12:55 PM, Robert DiFalco wrote: SELECT * FROM MyTable WHERE upper(FullName) LIKE upper('%John%'); That said, which would be the best extension module to use? A gist index on the uppercased column? Or something else? Thanks! Performance

Re: [GENERAL] String searching

2014-11-18 Thread Andy Colson
On 11/17/2014 7:54 PM, Jonathan Vanasco wrote: On Nov 17, 2014, at 12:55 PM, Robert DiFalco wrote: SELECT * FROM MyTable WHERE upper(FullName) LIKE upper('%John%'); That said, which would be the best extension module to use? A gist index on the uppercased column? Or something else?

Re: [GENERAL] String searching

2014-11-18 Thread Jonathan Vanasco
On Nov 18, 2014, at 7:38 AM, Albe Laurenz wrote: That index wouldn't help with the query at all. If you really need a full substring search (i.e., you want to find howardjohnson), the only thing that could help are trigram indexes. I stand corrected. I ran a sample query on my test

Re: [GENERAL] String searching

2014-11-18 Thread Robert DiFalco
Thanks everyone. Either I'm not that smart or I am working on too many things at once (or both) but making Full Text work seems super tedious. I just have a single VARCHAR field for name, so the full name William S. Burroughs is a single row and column. I want to as simply as possible have the

Re: [GENERAL] String searching

2014-11-18 Thread Jonathan Vanasco
On Nov 18, 2014, at 11:49 AM, Robert DiFalco wrote: As far as I can tell, the trigram extension would be the easiest way to implement this. It looks like I wouldn't need to mess with vectors, etc. It would just look like a standard index and query, right? It seems that if I need something

Re: [GENERAL] String searching

2014-11-18 Thread Vick Khera
On Tue, Nov 18, 2014 at 11:49 AM, Robert DiFalco robert.difa...@gmail.com wrote: Either I'm not that smart or I am working on too many things at once (or both) but making Full Text work seems super tedious. I just have a single VARCHAR field for name, so the full name William S. Burroughs is a

Re: [GENERAL] String searching

2014-11-18 Thread Kevin Grittner
Robert DiFalco robert.difa...@gmail.com wrote: I just have a single VARCHAR field for name, so the full name William S. Burroughs is a single row and column. I want to as simply as possible have the ability to search find this record with Will, will, Burr, burroughs, etc. As far as I can

[GENERAL] String searching

2014-11-17 Thread Robert DiFalco
I notice there are several modules to create specialized indices in PostgreSQL for searching VARCHAR data. For example, fuzzy, trigram, full text, etc. I've been googling around but I can't find the optimal method (reasonable speed and size, simplicity) for my use case. My text searches will

Re: [GENERAL] String searching

2014-11-17 Thread Jonathan Vanasco
On Nov 17, 2014, at 12:55 PM, Robert DiFalco wrote: SELECT * FROM MyTable WHERE upper(FullName) LIKE upper('%John%'); That said, which would be the best extension module to use? A gist index on the uppercased column? Or something else? Thanks! Performance wise, I think a function

Re: [GENERAL] String searching

2014-11-17 Thread David G Johnston
Jonathan Vanasco-7 wrote The reason is that GIN/GIST use language patterns to simplify the index. so they work great on words select plainto_tsquery('doing watching reading programming'); 'watch' 'read' 'program' but not so great on names: select