Since upgrading to 1.5.5 the global search has been timing out and causing the site to crash. I enabled sql times in the config file and it show 2 queries taking over a minute to execute:
SelectLimit array ( 0 => 'SELECT ual.local,ual.id,ual.func,ual.args FROM utils_attachment_link ual WHERE ual.deleted=0 AND (0!=(SELECT count(uan.id) FROM utils_attachment_note AS uan WHERE uan.attach_id=ual.id AND uan.text LIKE CONCAT(\'%\',?,\'%\') AND uan.revision=(SELECT MAX(xxx.revision) FROM utils_attachment_note xxx WHERE xxx.attach_id=ual.id)) OR 0!=(SELECT count(uaf.id) FROM utils_attachment_file AS uaf WHERE uaf.attach_id=ual.id AND uaf.original LIKE CONCAT(\'%\',?,\'%\') AND uaf.deleted=0)) AND ual.local LIKE \'%\'', 1 => 50, 2 => -1, 3 => array ( 0 => 'jones', 1 => 'jones', ), ) 71.9009
and later in the sequence:
SelectLimit array ( 0 => 'SELECT ual.local,ual.id,ual.func,ual.args FROM utils_attachment_link ual WHERE ual.deleted=0 AND (0!=(SELECT count(uan.id) FROM utils_attachment_note AS uan WHERE uan.attach_id=ual.id AND uan.text LIKE CONCAT(\'%\',?,\'%\') AND uan.revision=(SELECT MAX(xxx.revision) FROM utils_attachment_note xxx WHERE xxx.attach_id=ual.id)) OR 0!=(SELECT count(uaf.id) FROM utils_attachment_file AS uaf WHERE uaf.attach_id=ual.id AND uaf.original LIKE CONCAT(\'%\',?,\'%\') AND uaf.deleted=0)) AND ual.local LIKE \'%\'', 1 => 50, 2 => -1, 3 => array ( 0 => 'jones', 1 => 'jones', ), ) 74.0904
Any ideas why this query would takes so long?
Thanks,
Jon