My client's LF 9 system periodically runs some queries on their SQL Server that take a long time to execute (up to several hours), so I'm trying to determine the origin of the queries (for example, is this a LF housekeeping function? part of the index service? etc.) All of the queries include a temporary
sql table called either #search_entry_cache or #search_entry_cache2.
Here is one of the problem queries — does anybody recognize what might be the source of this?
Thanks,
Ken
SELECT tocid,
parentid,
etype,
vol_id,
acl_tocid,
(
SELECT Count(d.tocid)
FROM ann a
JOIN doc d
ON a.page_id = d.page_id
WHERE a.ann_type = 2
AND d.tocid = toc.tocid ) AS redactions,
CASE
WHEN acl_tocid IS NULL THEN - 1
ELSE
CASE
WHEN acl_tocid = tocid THEN 0
ELSE
CASE
WHEN acl_tocid = parentid THEN 1
ELSE 2
END
END
END AS depth
FROM toc
INNER JOIN #search_entry_cache
ON tocid = entry_id