0
我有兩個內連接在我的SQL查詢:兩個內連接導致執行速度慢
SELECT `M`.`msg_id`,
`U`.`username`,
`U`.`seo_username`
FROM `newdb2`.`users` AS `U`
INNER JOIN (SELECT subscriber_to_id
FROM subscriptions
WHERE subscriber_id = 434) AS subscriber
ON id = subscriber_to_id
INNER JOIN `newdb2`.`messages` AS `M`
ON (`M`.`uid_fk` = `U`.`id`)
ORDER BY id DESC LIMIT 10
當我執行此查詢我看實在是太慢了。 如何修改thi?查詢以使其更快?
有多少行有thoose表? –
列出您擁有的索引。 –