小编tee*_*boy的帖子

天蓝色的服务面料可靠的字典linq查询非常慢

我在服务结构状态服务中有一个可靠的字典.我有一个简单的linq表达式.
我正在使用Ix-Async包来构建一个asyncenumerable.


using (ITransaction tx = this.StateManager.CreateTransaction())  
        {  

          var result = (await customers.CreateLinqAsyncEnumerable(tx))
                .Where(x => x.Value.NameFirst != null && x.Value.NameFirst.EndsWith(n, StringComparison.InvariantCultureIgnoreCase))
                    .Select(y => y.Value);

           return await result.ToList();


        }  
Run Code Online (Sandbox Code Playgroud)

数据被组织成2个分区,每个分区中有大约75,000条记录.我使用Int64范围作为分区键.在上面的代码中,"Result.ToList()"大约需要1分钟来执行每个分区.另一个问题是,实际结果是空的!在sql server中运行的相同sql返回客户名以"c"结尾的行.但是,这是重点.我最关心的是"ReliableDictionary"linq查询的表现.
问候

c# performance linq-to-entities microservices azure-service-fabric

4
推荐指数
1
解决办法
1767
查看次数