Pepelac
Well-known member
I clearly understand that this is not a XF issue, but...
This query is not using index on the view_date column
It could be "fixed" by forcing an index. For example, query plan before forcing the index on view_date column:
and after forcing:
This query is not using index on the view_date column
Code:
SELECT session_activity.*
,
user.*,
user_profile.*,
user_option.*
FROM xf_session_activity AS session_activity
LEFT JOIN xf_user AS user ON
(user.user_id = session_activity.user_id)
LEFT JOIN xf_user_profile AS user_profile ON
(user_profile.user_id = user.user_id)
LEFT JOIN xf_user_option AS user_option ON
(user_option.user_id = user.user_id)
WHERE (session_activity.view_date > 1382086508)
ORDER BY session_activity.view_date DESC
It could be "fixed" by forcing an index. For example, query plan before forcing the index on view_date column:
and after forcing: