Reply to thread

Another one, less major but still likely worth it is an index on find_new on xf_forum for:

SELECT thread.*,

                                        user.*, IF(user.username IS NULL, thread.username, user.username) AS username,

                                        node.title AS node_title,

                                        forum.*,

                                        forum.last_post_id AS forum_last_post_id,

                                        forum.last_post_date AS forum_last_post_date,

                                        forum.last_post_user_id AS forum_last_post_user_id,

                                        forum.last_post_username AS forum_last_post_username,

                                        forum.last_thread_title AS forum_last_thread_title,

                                        thread.last_post_id,

                                        thread.last_post_date,

                                        thread.last_post_user_id,

                                        thread.last_post_username,

                                        post.message, post.attach_count,

                                permission.cache_value AS node_permission_cache

                                FROM xf_thread AS thread

                                        LEFT JOIN xf_user AS user ON

                                                (user.user_id = thread.user_id)

                                        LEFT JOIN xf_node AS node ON

                                                (node.node_id = thread.node_id)

                                        LEFT JOIN xf_forum AS forum ON

                                                (forum.node_id = thread.node_id)

                                        LEFT JOIN xf_post AS post ON

                                                (post.post_id = thread.first_post_id)

                                LEFT JOIN xf_permission_cache_content AS permission

                                        ON (permission.permission_combination_id = 1

                                                AND permission.content_type = 'node'

                                                AND permission.content_id = thread.node_id)

                                WHERE (thread.last_post_date > 1386369900) AND (forum.find_new = 1)

                                ORDER BY thread.last_post_date DESC

                         LIMIT 60;


Back
Top Bottom