J'ai la requête ci-dessous ... Cela fonctionne mais il fonctionne extrêmement lent. Est-ce que j'espérais que quelqu'un pourrait me donner quelques conseils pour améliorer le temps d'exécution?Requête mysql lente. Des conseils?
SELECT tb_clients.*, tb_clients_phone_fax.*
FROM tb_clients, tb_clients_phone_fax
WHERE tb_clients.client_id=tb_clients_phone_fax.client_id
AND MATCH (client_company,client_description,client_keywords) AGAINST ('test') > 0
AND CONCAT(client_address,' ',client_city,', ',client_state,' ',client_zip) LIKE '%brooklyn%'
LIMIT 10;
EDIT:
Voici l'info de table:
CREATE TABLE `tb_clients` (
`client_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`client_company` varchar(254) NOT NULL,
`client_address` varchar(254) NOT NULL,
`client_street` varchar(254) NOT NULL,
`client_city` varchar(254) NOT NULL,
`client_state` varchar(254) NOT NULL,
`client_zip` varchar(45) NOT NULL,
`client_email` varchar(254) NOT NULL,
`client_website` varchar(254) NOT NULL,
`client_description` text NOT NULL,
`client_keywords` text NOT NULL,
PRIMARY KEY (`client_id`) USING BTREE,
FULLTEXT KEY `client_company` (`client_company`,`client_description`,`client_keywords`)
) ENGINE=MyISAM AUTO_INCREMENT=68347 DEFAULT CHARSET=latin1;
ET
CREATE TABLE `tb_clients_phone_fax` (
`client_phone_fax_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`client_id` int(11) unsigned NOT NULL,
`client_phone_1` varchar(45) NOT NULL,
`client_phone_2` varchar(45) NOT NULL,
`client_phone_3` varchar(45) NOT NULL,
`client_fax_1` varchar(45) NOT NULL,
`client_fax_2` varchar(45) NOT NULL,
`client_fax_3` varchar(45) NOT NULL,
PRIMARY KEY (`client_phone_fax_id`) USING BTREE
) ENGINE=MyISAM AUTO_INCREMENT=33944 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;
Pouvons-nous supposer que '% brooklyn%' représente un paramètre de recherche? – ChaosPandion
Il serait utile d'afficher les types de données de chaque champ et les champs qui sont des indices. – philfreo
oui,% brooklyn% 'représente un paramètre de recherche. – mike