Breeze / breeze.server.net

Breeze support for .NET servers
MIT License
76 stars 62 forks source link

SQL Query Tunning #42

Closed lvasiliou closed 8 years ago

lvasiliou commented 8 years ago

Hello, I am not sure if this issue relates to Breeze Context Provider or EF SqlProvider but here it goes. We have an ASP.NET Web API with EF 6.1.3 model and today I noticed an interesting issue where if we request from the API method to sort by, expand and take/skip 20 rows and expand on multiple tables/entities, this translates to the following SQL query: JOIN on all rows in the primary table/entity against all expands, then sort then skip. Shouldn't it expand after filtering, skipping and sorting?

marcelgood commented 8 years ago

We have no control over the SQL that's being generated. The Breeze Context Provider just executes a LINQ query against EF and then EF produces the SQL from that. If you see issues with the generated SQL, you need to take that up with Microsoft.