我有一张包含 540 万条记录的表(产品)。如果我使用下面的查询来获得结果,但它的工作速度很慢。有没有更有效的方法?
SELECT sd.imageid, sd.licencetype, sd.imgcollection, sd.orientation,
sd.pname, sd.pcaption, sd.ptype
FROM (SELECT imageid
FROM product
WHERE productkeyword IN (SELECT primary_kwd
FROM searchkwdmgmt
WHERE allkwd IN ( 'IPhone' ))
GROUP BY imageid
HAVING Count(*) = 1
LIMIT 0, 31) q
JOIN searchdetails sd
ON sd.imageid = q.imageid