Re: the best way compare String

2011-12-05 Thread Basil Daoust
For the best chance to have a efficient query you would need to loose the leading "%" if possible. If you could then the query can optimize using a index. On Sun, Dec 4, 2011 at 2:50 PM, Reindl Harald wrote: > you THINK the engine is? WTF? > > fulltext if you need fulltext-search > please read th

Re: the best way compare String

2011-12-05 Thread Hal�sz S�ndor
;>>> 2011/12/04 20:25 +0100, Rafael Valenzuela In one query, I am comparing a string with a 'like=%patron%', but is very slow and expensive .What is the best way to compare a string? like or regular expression? The data base is too big table 1TB, any idea? Any decent implementation

Re: the best way compare String

2011-12-05 Thread Rafael Valenzuela
Thank you so much, i'll try to do this and, so sorry for any inconvenience 2011/12/5 Andrés Tello > > I use the soundex algorithm to generate a 4 characters fingerprint of the > phonetic sound of a string, then I create an index over that field and > serch for it. > > > But soundex has an "iss

Re: the best way compare String

2011-12-04 Thread Andrés Tello
I use the soundex algorithm to generate a 4 characters fingerprint of the phonetic sound of a string, then I create an index over that field and serch for it. But soundex has an "issue"... the soundex fingerprint should be the same for victor than for bictor, but since the soundex index uses the

Re: the best way compare String

2011-12-04 Thread Shiva
Rafael, Without more details it is hard how you can optimize a query. 1. even though database 1TB, what about the table on which your running this query? Do you have any index on the column? How may chars long is the column? etc. 2. Run the explain and see what is the optimizer is telling - using

Re: the best way compare String

2011-12-04 Thread Reindl Harald
you THINK the engine is? WTF? fulltext if you need fulltext-search please read the manuals i linked! Am 04.12.2011 21:20, schrieb Rafael Valenzuela: > Hi Reindl, > Thanks for your quick answer, but i think the engine is MySAM but I'm not > sure, What type of index recomendais me, unique, full-te

Re: the best way compare String

2011-12-04 Thread Rafael Valenzuela
Hi Reindl, Thanks for your quick answer, but i think the engine is MySAM but I'm not sure, What type of index recomendais me, unique, full-text, etc..? Thanks a lot 2011/12/4 Reindl Harald > > > Am 04.12.2011 20:25, schrieb Rafael Valenzuela: > > Hi all, > > In one query, I am comparing a stri