Hi,
in Azure SQL Database in Query Performance Insight → Long Running Queries I have a query (see screenshot) and I can’t seem to find what is triggering this query. In the second screenshot you can see that every execution takes about 7 seconds.
I have an item table with a system versioning table called item_history in Azure database but I already checked in Software Factory if there is anything that could trigger the query but can’t seem to find anything.
Does someone have an explanation for this ? Or can give me some pointers to look elsewhere.
Thank you.
Query in text:
SELECT [tsf_valid_from],[tsf_valid_to],[$S],[$tabType] FROM (SELECT [tsf_valid_from],[tsf_valid_to],LAG ([tsf_valid_to]) OVER (PARTITION BY [item_id] ORDER BY [tsf_valid_from],[tsf_valid_to]) AS [$S],[$tabType] FROM (SELECT [item_id],[tsf_valid_from],[tsf_valid_to], 0 AS [$tabType] FROM [dbo].[item_history] UNION ALL SELECT [item_id],[tsf_valid_from],[tsf_valid_to], 1 AS [$tabType] FROM [dbo].[item]) AS R) AS T


Kind regards,
Tim