From: "Shashank Tripathi" <[EMAIL PROTECTED]>
>This will be fast if you have the right index--
> field5 like 'John%'
>These will NOT be fast --
> field5 like '%John%'
> field5 like '%John'
>Putting a wildcard character ("%") before the term will avoid the index.
Yep, and it's for that point that an index on varchars and text will not
help me ...
> alter table mytable add index (myvarchar, mytext(100))
I think that the index will too big to be usefull for me.
Other way if i need an index, so perhaps i can try FULLTEXT.
I'm currently building a fulltext index on a test server but it's lonnnggggg
to do that :)
> One last resort that may work for you is to try the regexp instead of
> LIKE. The functionality of regexps for me has at best been
> unpredictable, sometimes it is faster, sometimes at par with LIKEs.
>
> So,
>
> " where CONTENT like '%word1%'
> or CONTENT like '%word2%'
> or CONTENT like '%word3%' "
>
> becomes,
>
> " where CONTENT regexp 'word1|word2|word3' "
>
>
Why not regexp but this is not i mean, in fact
" where CONTENT like '%word1%'
> or CONTENT like '%word2%'
> or CONTENT like '%word3%' "
shoud be :
" where CONTENT1 like '%word%'
> or CONTENT2 like '%word%'
> or CONTENT3 like '%word%' "
So i'll be 3 regexp i think ...
Other big problem is why mysql locked all queries during executing this one
...
Thanks
David
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php