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 of like

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 h.rei...@thelounge.netwrote: you THINK the engine is? WTF? fulltext if you need

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 h.rei...@thelounge.net Am 04.12.2011 20:25, schrieb Rafael Valenzuela: Hi all, In one query, I am

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,

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 -