Hallo,
ich habe einen recht großen Blog mit ca. 115.000 Posts und täglich werden ca. 1000 neue Beiträge erstellt. Leider macht mir Wordpress da mittlerweile Load-Probleme beim Einstellen der Beiträge. Meinem "mysql slow query log" kann ich entnehmen, dass beim Erstellen der Beiträge eine bestimmte Abfrage "SELECT SQL_CALC_FOUND_ROWS" sehr viel Last verursacht:
Code
# User@Host: dboXXXXXXXXX[dboXXXXXXXXX] @ localhost []
# Query_time: 10 Lock_time: 2 Rows_sent: 10 Rows_examined: 116763
SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish') ORDER BY wp_posts.post_date DESC LIMIT 0, 10;
# User@Host: dboXXXXXXXXX[dboXXXXXXXXX] @ localhost []
# Query_time: 10 Lock_time: 2 Rows_sent: 10 Rows_examined: 116763
SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish') ORDER BY wp_posts.post_date DESC LIMIT 0, 10;
# User@Host: dboXXXXXXXXX[dboXXXXXXXXX] @ localhost []
# Query_time: 9 Lock_time: 1 Rows_sent: 10 Rows_examined: 116763
SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish') ORDER BY wp_posts.post_date DESC LIMIT 0, 10;
# Time: 101202 10:38:24
# User@Host: dboXXXXXXXXX[dboXXXXXXXXX] @ localhost []
# Query_time: 8 Lock_time: 1 Rows_sent: 10 Rows_examined: 116764
SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish') ORDER BY wp_posts.post_date DESC LIMIT 0, 10;
# User@Host: dboXXXXXXXXX[dboXXXXXXXXX] @ localhost []
# Query_time: 8 Lock_time: 1 Rows_sent: 10 Rows_examined: 116764
SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish') ORDER BY wp_posts.post_date DESC LIMIT 0, 10;
# User@Host: dboXXXXXXXXX[dboXXXXXXXXX] @ localhost []
# Query_time: 8 Lock_time: 1 Rows_sent: 10 Rows_examined: 116764
SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish') ORDER BY wp_posts.post_date DESC LIMIT 0, 10;
# User@Host: dboXXXXXXXXX[dboXXXXXXXXX] @ localhost []
# Query_time: 8 Lock_time: 1 Rows_sent: 10 Rows_examined: 116764
SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish') ORDER BY wp_posts.post_date DESC LIMIT 0, 10;
Alles anzeigen
Kann mir eventuell jemand sagen, ob das ein bekanntes Problem ist und was man dagegen unternehmen könnte?
Zudem kommt ab und zu im Log eine Abfrage vor, die echt gewaltig ist. Ich habe die AND Abfrage mal gekürzt, da dort mehrere tausend Werte abgefragt werden:
Code
# Time: 101202 10:35:35
# User@Host: dboXXXXXXXX[dboXXXXXXX] @ localhost []
# Query_time: 10 Lock_time: 3 Rows_sent: 10 Rows_examined: 132148
SELECT * FROM wp_posts WHERE post_status IN ('publish') AND wp_posts.ID IN ('26823', '26824', '26827', '26829', '26831', '26833', '26835', '26837', '26839', '26840', '26843', '26845', '26846', '26848', '26850', '26851', '26853', '26855', '26857', '26859', '26861', '26863', '26865', '26866', '26867', '26868', '26869', '26870', '26871', '26872', '26873', '26874', '26875', '26876', '26877', '26878', '26879', '26880', '26881', '26882', '26883', '26884', '26885', '26886', '26887', '26888', '26889', '26890', '26891', '26892', '26893', '26894', '26895', '26896', '26897', '26898', '26899', '26900',.....................ABGEKÜRZT........... '117338', '117339', '117340') AND post_type='post' AND ID != 58028 AND post_password ='' ORDER BY RAND() LIMIT 0, 10;
Hat hier jemand eine Idee, woher diese Abfrage kommen könnte?
Gruß und Danke!