简体   繁体   English

实体框架核心-仅使用EF,执行SQL Server并获取结果的“查询处理器耗尽了内部资源”错误

[英]Entity Framework Core - “The query processor ran out of internal resources” error only using EF, executing SQL server and get the results

Using Entity Framework Core 2.0, I have a set of queries to produce a result and it works flawlessly... 使用Entity Framework Core 2.0,我有一组查询来产生结果,并且可以完美地工作...

Except, for one specific query using EF .where() statements to build up the query, this and it throw's "The query processor ran out of internal resources and could not produce a query plan". 对于使用EF .where()语句来构建查询的一个特定查询,它抛出了“查询处理器用尽内部资源并且无法生成查询计划”的提示。

I've output the produces SQL and used SQL profiler - and executing the exact query in SQL Server (2016) takes less than one second, so I'm at a bit of a loss of how to diagnose this any further... 我已经输出了产生式SQL并使用了SQL事件探查器-在SQL Server(2016)中执行确切的查询不到一秒钟,所以我对如何进一步诊断这一点感到有点茫然...

What would be the next steps to diagnose this error? 诊断该错误的下一步是什么?

Try breaking your query up into smaller pieces, as Microsoft suggests . 按照Microsoft的建议 ,尝试将查询分解为较小的部分。 Some possibilities might include taking vertical slices of your data using Skip and Take and handling them one at a time. 一些可能性可能包括使用“ 跳过并获取”来获取数据的垂直切片并一次处理一个。 Another option would be to bring your query in-memory with a .ToArray() call before your .Where(), so it won't be SQL handling that complex query, but your machine. 另一个选择是在.Where()之前通过.ToArray()调用将查询带入内存中,因此将不是SQL处理该复杂查询,而是您的计算机。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 查询处理器用尽了内部资源,无法在EF中生成查询计划 - The query processor ran out of internal resources and could not produce a query plan in EF 使用 Entity Framework Core 在 SQL Server 查询中参数化 OPENJSON - Parameterized OPENJSON in SQL Server query using Entity Framework Core 实体框架核心; 在对(MS)SQL Server的查询中使用ORDER BY - Entity Framework Core; using ORDER BY in query against a (MS) SQL Server 使用实体框架执行原始SQL查询 - Executing raw sql query using Entity Framework 无法在Entity Framework中使用SQL查询获取数据 - Can't get data out using SQL query in Entity Framework 在 SQL CLR 中使用 Entity Framework 6 / EF Core - Using Entity Framework 6 / EF Core inside SQL CLR Entity Framework Core - 同时运行的查询在不同的环境中表现不同 - Entity Framework Core - Query ran simultaneously behaves differently on different environment 在SQL Server 2012中使用Entity Framework 5时出错 - Error using Entity Framework 5 with SQL Server 2012 如何使用带 ef 核心的 DateOnly 查询 SQL 服务器 - How to query SQL Server using DateOnly with ef core NET 6 - 实体框架核心错误:SQL 服务器未找到或无法访问 - NET 6 - Entity Framework Core Error: SQL Server was not found or was not accessible
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM