From: "Mikhail Entaltsev" <[EMAIL PROTECTED]> ME> Check the query plan ME> EXPLAIN SELECT Field1,Field2,Field3,Field4,Field5,Field6,Field7 FROM ME> MyTable WHERE ME> Field7=15 AND Field2=0 AND (Field3 LIKE '%John%' OR Field4 LIKE '%John%' OR ME> Field5 LIKE '%John') ORDER BY Field6 LIMIT 0,20;
| table | type | possible_keys | key | key_len | ref | rows | Extra | +--------+------+-----------------------+--------+---------+-------------+-- -----+------------+ | MyTable | ref | ReplyTo_Numero,indexF | indexF | 8 | const,const | 51145 | where used | 1 row in set (0.01 sec) Table desc : CREATE TABLE MyTable ( Field1 int(10) unsigned NOT NULL auto_increment, Field2 int(10) unsigned NOT NULL default '0', Field3 varchar(50) NOT NULL default '', Field4 varchar(50) NOT NULL default '', Field5 text NOT NULL, Field6 bigint(20) NOT NULL default '0', Field7 int(10) unsigned NOT NULL default '0', PRIMARY KEY (Field1), KEY ReplyTo_Numero (Field2,Field1), KEY indexF (Field7,Field2,Field6) ) TYPE=MyISAM PACK_KEYS=1; 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