langsame viewforum.php (mysqlselect)
Verfasst: 04.09.2005 23:39
Hi,
seit geraumer Zeit fällt mir auf das ein Query in viewforum.php (seite xxx) sehr lange brauch um Ergebnisse zu liefern:
ergebnis vom explain:
scheinbar nutzt mysql den index nicht oder ich interpretiere es falsch... auf jedenfall brauch das query über 20 sekunden und zwingt den server für diese zeit deutlich in die knie.
vielleicht hat jemand ne idee
Gruss
seit geraumer Zeit fällt mir auf das ein Query in viewforum.php (seite xxx) sehr lange brauch um Ergebnisse zu liefern:
Code: Alles auswählen
explain SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time, pt.post_text, pt.bbcode_uid
FROM phpbbboard_topics t, phpbbboard_users u, phpbbboard_posts p, phpbbboard_posts p2, phpbbboard_users u2, phpbbboard_posts_text pt
WHERE t.forum_id = 8
AND t.topic_poster = u.user_id
AND p.post_id = t.topic_first_post_id
AND p2.post_id = t.topic_last_post_id
AND p2.post_id = pt.post_id
AND u2.user_id = p2.poster_id
ORDER BY t.topic_type DESC, t.topic_last_post_id DESC LIMIT 12775, 25;
Code: Alles auswählen
+----+-------------+-------+--------+-------------------+----------+---------+----------------------------------+-------+-----------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------+--------+-------------------+----------+---------+----------------------------------+-------+-----------------------------+
| 1 | SIMPLE | t | ref | forum_id | forum_id | 2 | const | 11169 | Using where; Using filesort |
| 1 | SIMPLE | u | eq_ref | PRIMARY | PRIMARY | 3 | db65681789.t.topic_poster | 1 | |
| 1 | SIMPLE | p | eq_ref | PRIMARY | PRIMARY | 3 | db65681789.t.topic_first_post_id | 1 | |
| 1 | SIMPLE | p2 | eq_ref | PRIMARY,poster_id | PRIMARY | 3 | db65681789.t.topic_last_post_id | 1 | |
| 1 | SIMPLE | u2 | eq_ref | PRIMARY | PRIMARY | 3 | db65681789.p2.poster_id | 1 | |
| 1 | SIMPLE | pt | eq_ref | PRIMARY | PRIMARY | 3 | db65681789.p2.post_id | 1 | |
+----+-------------+-------+--------+-------------------+----------+---------+----------------------------------+-------+-----------------------------+
vielleicht hat jemand ne idee

Gruss