如何增加这个MySQL查询的性能如何优化MySQL查询
SELECT '' AS sharedid,
hubber_posts.userID AS postowner,
hubber_posts.*,
'' AS sharedby,
hubber_posts.userID AS userID,
hubber_posts.posted_date AS DATE,
'' AS sharebyusr,
'' AS sharebyusrimg,
Concat_ws(' ', firstname, lastname) AS fullname,
username AS postedBy,
hubber_user.image,
hubber_user.gender AS gender,
(SELECT accounttype
FROM hubber_user_security us
WHERE hubber_user.ID = us.userID
AND hubber_posts.userID = us.userID) AS accounttype,
'' AS sharebyusrtype
FROM hubber_posts
INNER JOIN hubber_user
ON hubber_posts.userID = hubber_user.ID
WHERE hubber_posts.status = 1
请尽量把一些精力来格式化T他查询。 –
我投票结束这个问题作为题外话,因为性能问题应该包括EXPLAIN ANALYZE和关于表格大小,索引,当前时间表现,欲望时间等的一些信息。慢是一个相对术语,我们需要一个真正的价值来比较。 MySQL也请阅读[如何 - 问](http://stackoverflow.com/help/how-to-ask) – e4c5
你需要阅读这个建议提出一个问题,我们可以回答。 http://meta.stackoverflow.com/questions/271055/tips-for-asking-a-good-structured-query-language-sql-question/271056#271056 –