I'm attempting to debug a site with intermittent slowness, and I've managed to track it down to a long series of file_usage queries which appear to be coming from a search_index rebuild.
SELECT base.fid AS fid, base.uid AS uid, base.filename AS filename, base.uri AS uri, base.filemime AS filemime, base.filesize AS filesize, base.status AS status, base.timestamp AS timestamp
FROM
file_managed base
WHERE (base.fid IN ('50545'))
And
SELECT f.module AS module, f.type AS type, f.id AS id, f.count AS count
FROM
file_usage f
WHERE (fid = '22638') AND (count > '0')
These queries appear to be triggered on random page loads, and they continue until they are killed, or the page times out.
I thought it might have something to do with rebuilding the search index, so I've added
$conf['search_cron_limit'] = '0';
To settings.php to no avail. There are a whole lot of modules on this site, so I don't really know where to start.