You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When loading related entities, we currently generate orderings to group together rows for the same entity. This is necessary for queries without identity resolution, since the shaper detects that new entities by the change in identifier. However, queries with identity resolution perform local lookup anyway, so these orderings aren't needed.
For example, consider a Blog with two collection navigations, Posts and Authors. When loading this entire graph, we currently generate:
SELECT[b].[Id],[b].[Name],[p].[Id],[p].[BlogId],[a].[Id],[a].[BlogId]FROM[Blogs] AS [b]LEFT JOIN [Post]AS[p] ON [b].[Id]=[p].[BlogId]LEFT JOIN [Author]AS[a] ON [b].[Id]=[a].[BlogId]ORDER BY [b].[Id],[p].[Id],[a].[Id]
Queries using identity resolution could omit the last two orderings.
This would potentially imply more local dictionary lookups, as rows are returned unordered and the shaper needs to jump back and forth between instances. My gut feeling is that the server-side ordering is much more expensive, but we'd have to confirm this first.
When loading related entities, we currently generate orderings to group together rows for the same entity. This is necessary for queries without identity resolution, since the shaper detects that new entities by the change in identifier. However, queries with identity resolution perform local lookup anyway, so these orderings aren't needed.
For example, consider a Blog with two collection navigations, Posts and Authors. When loading this entire graph, we currently generate:
Queries using identity resolution could omit the last two orderings.
This would potentially imply more local dictionary lookups, as rows are returned unordered and the shaper needs to jump back and forth between instances. My gut feeling is that the server-side ordering is much more expensive, but we'd have to confirm this first.
/cc @smitpatel
The text was updated successfully, but these errors were encountered: