Jean-Baptiste
Well-known member
Hello,
I made a query, that fetch a post and it's associated thread and user. But when I run it on my production board it's taking ages to load, the debug mode show 10 to 25 seconds on this query.
I don't have any problems on my developement forum, but I do on my big board.
This morning, I switched all my tables to InnoDB (the tables that needed to be like that, because years ago when I switch from vBulletin the import made my tables MyISAM). Could InnoDB be the reason ?
Here is my code :
Query :
Best regards.
I made a query, that fetch a post and it's associated thread and user. But when I run it on my production board it's taking ages to load, the debug mode show 10 to 25 seconds on this query.
I don't have any problems on my developement forum, but I do on my big board.
This morning, I switched all my tables to InnoDB (the tables that needed to be like that, because years ago when I switch from vBulletin the import made my tables MyISAM). Could InnoDB be the reason ?
Here is my code :
PHP:
public function getTopicsBy($by = "custom_param", $start = 0, $stop = 30)
{
$threads = $this->_getDb()->fetchAll("
SELECT xf_post.*, xf_user.*, xf_thread.*
FROM xf_post
INNER JOIN xf_user ON (xf_user.user_id = xf_post.user_id)
INNER JOIN xf_thread ON (xf_thread.thread_id = xf_post.thread_id)
WHERE xf_post.custom_param = 1
ORDER BY xf_post.post_date DESC
LIMIT ?, ?
", array($start, $stop));
return $threads;
}
Query :
Code:
SELECT xf_post.*, xf_user.*, xf_thread.*
FROM xf_post
INNER JOIN xf_user ON (xf_user.user_id = xf_post.user_id)
INNER JOIN xf_thread ON (xf_thread.thread_id = xf_post.thread_id)
WHERE xf_post.custom_param = 1
ORDER BY xf_post.post_date DESC
LIMIT ?, ?
Best regards.