ayetler表 = 6500行
fihristayet表 = 13279行
SQL查询:
SELECT ayetler.ayet_tr
FROM fihristayet,ayetler
WHERE (fihristayet.fihristAyet_ayet=ayetler.ayet_no AND
fihristayet.fihristAyet_sure_id=ayetler.sure_id)
AND fihristayet.fihristAyet_fihrist_id=354
我有15行返回。为什么记录会在40秒后到达
答案 0 :(得分:0)
首先,学习使用正确的,明确的,标准 JOIN
语法。 从不在FROM
子句中使用逗号。因此,您的查询应如下所示:
SELECT a.ayet_tr
FROM fihristayet f JOIN
ayetler a
ON f.fihristAyet_ayet = a.ayet_no AND
f.fihristAyet_sure_id = a.sure_id
WHERE f.fihristAyet_fihrist_id = 354;
然后您要在fihristayet(fihristAyet_fihrist_id, fihristAyet_ayet, fihristAyet_sure_id)
和ayetler(ayet_no, sure_id)
上建立索引。