MySQL Forums
Forum List  »  Optimizer & Parser

Re: CPU usage 99% - and query very slow - help
Posted by: Øystein Grøvlen
Date: August 15, 2012 03:09AM

I see your slow log contains a lot of queries with predicates like "search_name LIKE '%Kaspersky%'". Note that the LIKE operator can only use indexes when searching for prefixes of strings. Hence, when searching for strings starting with '%', normal indexes will not be used.

I see you have full text indexes defined. However, in order to use them, you need to use the MATCH function. That is, instead of the LIKE-expression above, you should write something like "MATCH(search_name) AGAINST ('Kaspersky')".

Fult text indexing for InnoDB will be available in the upcoming MySQL 5.6 release.

HTH,

Øystein Grøvlen,
Senior Principal Software Engineer,
MySQL Group, Oracle,
Trondheim, Norway

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: CPU usage 99% - and query very slow - help
2093
August 15, 2012 03:09AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.