MySQL Forums
Forum List  »  Performance

Optimizing slow query
Posted by: mazalov
Date: February 25, 2005 10:55AM

This query runs very slow. ~40 seconds.

SELECT count(*) as cnt FROM tel1_offices,tel1_phones WHERE (tel1_offices.M_index=tel1_phones.M_index) AND (tel1_offices.Offname LIKE '%a%');

When I change %a% to %aa% it runs more faster.
Whe change to %aaa% script runs ~10 seconds.

How to optimize my DB, that first query will run faster ~10sec?

Options: ReplyQuote

Written By
Optimizing slow query
February 25, 2005 10:55AM
February 27, 2005 07:30PM

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.