Deadlock found when trying to get lock; try restarting transaction
SELECT id , titolo_it as titolo, testo_it as testo, image , link_pagina,
(SELECT
IF((SELECT id FROM strutturapagine WHERE attivo = 'on' AND sottopagina_di = '' ORDER BY ordine DESC LIMIT 1) = link_pagine.link_pagina , '' , permalink_it)
FROM strutturapagine WHERE id = link_pagine.link_pagina) as permalink ,
(SELECT titolo_it FROM strutturapagine WHERE id = link_pagine.link_pagina) as titolopagina
FROM link_pagine
WHERE titolo_it != ''
AND pagina = 75
ORDER BY ordine DESC limit 20