Slow query log on mariadb wordpress
-
Hi,
I got a lot slowlog query in mariaDB that make my DB CPU and RAM spiking, also slow down my website. My website have 3.000.000 visitor each month and 10K+ posts. This is slow log query in WP DB. There are 2 type of records, but it happend a lot.
Type 1 :
SET timestamp=1571303523; SELECT DISTINCT wp_posts.ID FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) WHERE 1=1 AND wp_posts.ID NOT IN (97947) AND ( wp_term_relationships.term_taxonomy_id IN (30,303,304,305,307,308,309,310,334,924,1603,1688,1948,2343,2439,3208,3299,36446,38216,38953,55313,57822,71755,91473,109736,114445) ) AND ( wp_postmeta.meta_key = '_thumbnail_id' ) AND wp_posts.post_type = 'post' AND ((wp_posts.post_status = 'publish')) GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 9, 3;
Type2
SET timestamp=1571303526; SELECT term_id, meta_key, meta_value FROM wp_termmeta WHERE term_id IN (76224,76227,334,1128,359,76226,754,147015,1068,518,350,434,468,347,411,328,76225,141360,69377,147774,502,787,486,342,280,275,274,340,128570,330,36754,352,353,375,276,277,278,339,273,239,333,241,236,945,373,356,281,237,11424,115373,357,607,524,240,42,74044,120842,109813,29541,122275,142761,84792,89171,76028,2096,2095,2094,45576,52197,99086,11605,122208,126044,72230,27297,2392,86374,82816,45408,45407,32478,32479,100085,142963,108783,91,117875,29540,1774,87956,87959,104127,32090,73707,2980,121462,138084,1169,60250,36873,40799,94801,116855,138643,101920,117949,56684,623,19119,132159,11308,139701,139700,35196,112798,139354,141511,36995,85208,1221,5461,117068,123244,122276,92400,91875,70083,139582,859,547,89553,88419,42529,521,142712,64563,144267,139605,64701,1784,77318,20416,150838,136084,147673,147066,124055,825,1067,20845,16207,134311,1713,119530,149148,46049,3018,141509,121145,92039,92040,144103,111489,72713,2901,24792,1869,134086,18373,29242,59788,39706,103434,2231,84970,40636,40635,122,1273,1272,21234,2232,1218,101060,146900,52157,27022,71241,103458,97536,3320,2624,112178,112180,15221,15222,1171,86555,46033,39051,556,142250,136463,128052,128031,149071,79879,129388,73357,136332,695,464,100412,53910,850,112515,61581,59105,61579,1862,97173,54244,107328,107329,104725,111747,126458,126461,15918,35274,61840,496,97489,22340,145412,120473,22337,136261,145411,145410,152406,144467,14933,42553,33424,133690,70573,70572,86398,1473,65231,63407,86397,95601,81653,81652,92042,92038,63409,35103,23608,23607,6427,25294,25295,7941,108558,104597,107418,125019,2993,142711,49440,520,91798,128330,108635,113100,2724,123725,2725,28472,154956,28440,131636,56253,102229,903,1282,2496,79420,63565,96665,82054,131238,63564,114306,131441,119736,105742,100190,138895,137462,153909,110907,34541,90142,91611,3087,70907,5463,32858,123104,123103,63528,132777,141214,152293,1090,1097,1183,1592,108237,15841,67003,38302,151555,937,103684,49284,17755,867,117950,982,2061,29539,50631,128249,270,18732,92869,117363,15897,84535,10076,579,110156,2015,84154,1429,256,18372,153001,47464,1328,1506,1507,88503,79935,2756,17335,76339,642,62827,2612,1777,1781,89906,8610,152759,152756,125850,40220,2235,24707,60423,61130,121127,1779,131088,2082,2385,136635,141292,90860,122482,1531,82818,31287,8609,95711,92166,93575,16840,42357,1776,138384,123,83741,1780,92165,7683,1778,3126,75206,141641,22073,12593,22074,109245,109244,13902,29679,149813,149812,141638,127107,35912,3124,103481,76180,63632,115414,3123,105983,105982,138219,116896,109864,67531,1579,109177,1926,2470,11942,116674,19265,18164,147538,147535,50555,123683,152509,65605,65606,371,112958,61131,87071,121483,58119,69548,33298,2266,2387,73921,127994,112130,94270,87370,2717,2269,83973,63233,96052,2268,2267,87372,152624,152556,152623,153572,153573,152380,75432,43384,79934,79933,114113,72752,2581,2658,72342,55773,119892,127457,127456,127455,106635,2712,97672,1658,2713,93365,1209,2258,1033,121727,133734,72835) ORDER BY meta_id ASC;
Can you give a hint what cause that and how to eliminate that.
Thanks
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Slow query log on mariadb wordpress’ is closed to new replies.