Hi,
ich optimiere soeben meine Queries und kriege so ein blödes count(id) nicht weg das mir ständig ein Using temporary und Using filesort erstellt.
Meine Abfrage
Code:
EXPLAIN SELECT dictionary, COUNT(status) as x, phrase
FROM system_lastphrases
WHERE dictionary = 1 AND `status` = 1
GROUP BY dictionary, status, phrase
ORDER BY x
Mein Index
HTML-Code:
(dictionary,status, phrase)
Meine Table
Code:
CREATE TABLE `system_lastphrases` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`dictionary` smallint(1) DEFAULT NULL,
`status` smallint(1) DEFAULT '1',
`phrase` varchar(70) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `iDictionaryStatusPhrase` (`dictionary`,`status`,`phrase`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
Wisst ihr wo der Fehler liegt?
thx!