我的查询如下
SELECT COUNT(*) AS count
FROM shop.CarInfo A
LEFT JOIN shop.RegisterInfo B
ON A.CarID = B.RegisterInfoID
LEFT JOIN shop.seller C
ON B.RegisterInfoID = C.CarID
LEFT JOIN shop.CarSeller D
ON C.CarSellerID = D.PersonID
LEFT JOIN shop.Licences E
ON B.RegisterInfoID = E.CarID
LEFT JOIN shop.CarLicences F
ON E.CarLicenceID = F.CarLicenceID
LEFT JOIN shop.CarsLocation G
ON A.location = G.CarLocationID
LEFT JOIN shop.AnnounceStatement H
ON B.RegisterInfoID = H.CarID
LEFT JOIN shop.Announcer I
ON H.AnnouncerID = I.AnnouncerID
WHERE B.title LIKE '%Mercedes%' OR D.name LIKE '%Mercedes%' OR F.Licences LIKE '%Mercedes%' OR B.RegNo LIKE '%Mercedes%' OR I.name LIKE '%Mercedes%'
不幸的是,这个查询需要很多回复!使用EXPLAIN EXTENDED
,我得到了这个:
http://i59.tinypic.com/bj9udh.png [由于我还无法将图片上传到StackOverflow,我已经上传到tinypic]
据我所知,除了第一行外,一切都很好。考虑到我已经创建了合适的索引,为什么这么多行呢?