private bool IsRecursionLoopInQueryText(string sql)
        {
            using (var query = _sqlContext.GetNewSqlQuery())
            {
                query.QueryRoot.AllowSleepMode = true;
                query.SQL = sql;

                return(!query.SleepMode &&
                       UserMetadataStructureItem != null &&
                       query.QueryStatistics.UsedDatabaseObjects.Any(
                           x => x.MetadataObject == UserMetadataStructureItem.MetadataItem));
            }
        }