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

asp.net-core c# entity-framework-core sql-server

Question

Using Entity Framework Core 2.0, I have a set of queries to produce a result and it works flawlessly...

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".

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...

What would be the next steps to diagnose this error?

1
0
12/11/2017 5:37:45 PM

Popular Answer

Try breaking your query up into smaller pieces, as Microsoft suggests. 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.

0
4/20/2018 6:36:01 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow