Performance bug – slow DB query


Since 2017-09-26 I have terrible problems with performance on my website.

Loading single post or any other page takes even 20s.
I’ve been debugging it it found out, that the problems are DB queries.

For example this one is executing almost with every page load and takes about 36s:

SELECT t.*, tt.*, tr.object_id
FROM   az2_terms AS t 
INNER JOIN az2_term_taxonomy AS tt
ON     t.term_id = tt.term_id
INNER JOIN az2_term_relationships AS tr
ON     tr.term_taxonomy_id = tt.term_taxonomy_id
WHERE  tt.taxonomy IN ('znacka', 'model')
AND    tr.object_id IN (27130, 27290, 27822, 27899, 30862, 33536, 33721, 34901, 37448, 37482, 37496, 37522, 37572, 37580, 37742, 37750, 38160, 38165)

When it’s executing for the second time, it’s lamost instant.
Since the 2017-09-26 I haven(t made any changes, only switched to HTTPS, could that be the problem?

, , Tomas Blaha 3 years 2020-05-30T15:10:26-05:00 0 Answers 71 views 0

Leave an answer