asked on August 18, 2016
Hello. We have noticed over the past two weeks, the size of the temp database for SQL Server has grown substantially larger than it previously has. Laserfiche is currently the only database on this SQL Server. We were able to get the query that was currently running for the past 2 weeks which inflated the log size. Can we get an explanation on what the query does? We would like to prevent this from happening again if possible. Thanks for your time.
with toc_tree (tocid, name, parentid, etype, toc_sdctl, bk, distance, origtocid, origetype, origvolid) as (select toc.tocid, name, toc.parentid, etype, toc_sdctl, toc_sdctl & 4096, 0, toc.tocid origtocid, etype origetype, vol_id origvolid from toc join searchresult0 on toc.tocid = searchresult0.tocid where searchresult0.rsid = 62521 and toc.toc_flags & 2048 = 0 and ((toc_flags & 1048576) = 0 or not exists ( select from entry_tag et join tag t on et.tag_id = t.tag_id where t.is_secure = 1 and et.tocid <> 1 and et.tocid = toc.tocid and (toc.etype <> -1 or et.tocid = toc.linkto) and not exists (select from sess_tag st where st.tag_id = et.tag_id and st.sess_id = 20636))) union all select t.tocid, t.name, t.parentid, t.etype, t.toc_sdctl, tr.bk | (t.toc_sdctl & 4096), tr.distance + 1, tr.origtocid, tr.origetype, tr.origvolid from toc t join toc_tree tr on t.tocid = tr.parentid and tr.bk = 0) select entry_acl_summary.id, (select toc.parentid from toc where toc.tocid = entry_acl_summary.id), (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 = entry_acl_summary.id) from (select id, case when sum(can_browse) > 0 and sum(can_read) > 0 then 1 else 0 end can_read_and_browse, case when count(allow_vol_read) > 0 and count(deny_vol_read) = 0 then 1 else 0 end can_read_vol from (select allow_acl.origtocid id, case when deny_acl.hasBrowse > 0 then 0 else allow_acl.hasBrowse end can_browse, case when deny_acl.hasRead > 0 then 0 else allow_acl.hasRead end can_read, (select top 1 vol_id from volacl where vol_id = allow_acl.origvolid andvolacl.sid in (select sid from sess_sid where sess_id = 20636) and ace_type = 0 and mask & 1 = 1) allow_vol_read, (select top 1 vol_id from volacl where vol_id = allow_acl.origvolid and volacl.sid in (select sid from sess_sid where sess_id = 20636) and ace_type = 1 and mask & 1 = 1) deny_vol_read from (select toc_tree.origtocid origtocid, toc_tree.origvolid origvolid, distance, toc_tree.origetype origetype, count(case when entryacl.mask & 1 = 1 then 1 else null end) hasBrowse, count(case when entryacl.mask & 2 = 2 then 1 else null end) hasRead from toc_tree join entryacl on toc_tree.tocid = entryacl.tocid where entryacl.ace_type = 0 and entryacl.sid in (select sid from sess_sid where sess_id = 20636) and not ((distance = 0 and ace_flags & 8 <> 0) or (distance > 0 and origetype < 0 and ace_flags & 1 = 0) or (distance > 0 and origetype >= 0 and ace_flags & 2 = 0) or (distance > 1 and ace_flags & 4 <> 0) ) and (entryacl.mask & 1 = 1 or entryacl.mask & 2 = 2) group by distance, origtocid,origvolid, origetype) allow_acl left join (select toc_tree.origtocid origtocid, toc_tree.origvolid origvolid, distance, toc_tree.origetype origetype, count(case when entryacl.mask & 1 = 1 then 1 else null end) hasBrowse, count(case when entryacl.mask & 2 = 2 then 1 else null end) hasRead from toc_tree join entryacl on toc_tree.tocid = entryacl.tocid where entryacl.ace_type = 1 and entryacl.sid in (select sid from sess_sid where sess_id = 20636) and not ((distance = 0 and ace_flags & 8 <> 0) or (distance > 0 and origetype < 0 and ace_flags & 1 = 0) or (distance > 0 and origetype >= 0 and ace_flags & 2 = 0) or (distance > 1 and ace_flags & 4 <> 0) ) and (entryacl.mask & 1 = 1 or entryacl.mask & 2 = 2) group by distance, origtocid, origvolid, origetype) deny_acl on allow_acl.distance >= deny_acl.distance and allow_acl.origtocid = deny_acl.origtocid ) acl_per_level group by id) entry_acl_summary where entry_acl_summary.can_read_and_browse = 1 and entry_acl_summary.can_read_vol = 1
0
0