user stats

Member SinceNovember 5, 2012
Last VisitJuly 24, 2014


developer for

Entity Framework


personal statement

No personal statement has been written.

activity stream

July 24, 2014 - Entity Framework: Commented work item: Projection With Null Check Causing Too Many Joins

July 24, 2014 - Entity Framework: Modified work item: [Perf] Regression between 6.1 and 6.1.1

July 24, 2014 - Entity Framework: Commented work item: [Perf] Regression between 6.1 and 6.1.1

July 22, 2014 - Entity Framework: Pushed 3e8d0cb80ddba0da5269076de4feb38344a2312b, In case of multiple properties referenced via a navigation property, the query pipline creates subqueries that project the corresponding columns and then OUTER APPLYs them. The OUTER APPLYs are later transformed into duplicate LEFT OUTER JOINS. The join elimnation phase is supposed to eliminate the duplicates. However it handles only equi-joins (with predicate of form columnA = columnB). In the repro case the navigation property returns a base type, which results in having an additional predicate that filters using the Discriminator column: [Extent2].[Discriminator] IN (N'DerivedTypeA',N'DerivedTypeB',N'DerivedTypeC',N'DerivedTypeD',N'DerivedTypeE') The join elimination phase simply shortcuts the exection and does not do anything if the joins are not exclusively equi-joins, the final query ends having unnecessary joins which seem to cause performance problems. An ideal solution would be to try to project all properties referenced via the navigation property in the given scope, thus not producing unnecessary joins. That requires rewritting the IQT, and after spending some time on it, it seemed complex and highly risky to do. The second option, which is implemented here, is to enhance the join elimination phase to handle some cases of non equi-join predicates. The JoinElimination phase builds a graph of tables and joins, then performs elimination by trying to turn left outer joins into inner joins, generating transitive edges, eliminating self joins, star self joins and parent child joins, then rebuilding the IQT. First I removed the top level check in JoinGraph.BuildJoinEdges that shortcuts the execution for non equi-joins. This allowed the code to build the parts of the graph that correspond to non equi-joins (have OtherPredicate). Then I moved the check into JoinEdge.RestrictedElimination, which is already called at a more granular level during join elimination, to make sure that the additional edges in the graph don't impact cases that don't know how to handle non equi-joins (generate transitive edges, eliminate self joins, parent-child joins). With these changes the code still runs on the path that eliminates star self joins (X join T1 join T2 join T3 ..., where T1, T2, T3 are instances of the same table). The rest of the changes handle the OtherPredicate on this execution path. The join edges that represent joins like "X join Ti" are grouped and then elimination is performed. To qualify for starting a start self join group a join edge has to respect conditions implemented by JoinGraph.QualifiesForStarSelfJoinGroup. I added code to this method to also check the non equi-join predicate (OtherPredicate). A relatively good condition for OtherPredicate is to refer columns from the right table only (behave like a filter on the right table). Additional edges are added to the group if the predicate matches. I added code to also match the OtherPredicate. Non equi-join predicate nodes match if their Ops match, and they have the same number of matching child nodes. In case of VarRefOp with ColumnVar the nodes match if they reference the same column.

July 18, 2014 - Entity Framework: Commented work item: Regression in 6.1.1 wrong left join instead of inner join

July 2, 2014 - Entity Framework: Pushed ee167be1d95c67d5788955aed2302a7398ca5ae8, This commit provides a fix for issue 633 (https://entityframework.codeplex.com/workitem/633): Lack of UNION/UNION ALL flattening causes errors due to queries "nested too deeply". The primary difficulty with making the fix came from the fact that, by the time nested union all queries get to SQL gen, each set operator has been wrapped in a "no-op" projection by the CTreeGenerator. I couldn't find an easy way to detect whether a particular projection was one of these no-ops, so I modified CTreeGenerator to avoid creating the extra projections in the case of UNION ALL and INTERSECT trees. The change in SqlGenerator is then fairly simple; instead of rendering a set operator as Visit(left), separator, Visit(right), we first expand the tree to get a list of "leaf" nodes and render as Vist(leaf[0]), separator, Visit(leaf[1]), separator, ... Since UNION ALL has some special-case behavior for Sql 8.0, I disabled the tree expansion logic for that version so that we fall back to something equivalent to the previous code.

July 1, 2014 - Entity Framework: Commented work item: [Perf] Regression between 6.1 and 6.1.1

June 26, 2014 - Entity Framework: Commented work item: Sql 2012 tests running and failing when Sql Express is a previous version

June 24, 2014 - Entity Framework: Pushed 431b48ec28d1ade4b9367987a54053f34df106ac, Work item 961: Add SQL Server 2012 support for OFFSET ... FETCH statements instead of row_number OVER. Implementation for using SQL Server 2012's OFFSET ... FETCH statement on SQL Server 2012 and newer instead of row_number OVER. From my (basic) research, there is no large performance gain from using the new method; however, this is a cleaner and more understandable approach to paging. Much of the functionality was derived from the SqlServerCompact implementation of OFFSET ... FETCH. Converts some unit test classes into generics to allow testing both <=2008 and =2012 versions of the results using the same base test code (see /test/EntityFramework/FunctionalTests/PlanCompiler/LimitExpressionTests.cs). Adds test contexts that derive from the original context, but with named appended with _2012 for testing as Sql Server 2012 contexts (as opposed to the default 2008, see /test/EntityFramework/FunctionalTests.Transitional/TestHelpers/FunctionalTestsManifestTokenResolver.cs). Using separate context types prevents plan caching across the two modes. All tests that tested Skip SQL production and functionality have been duplicated to ensure coverage.

June 24, 2014 - Entity Framework: Modified work item: UpForGrabs: Support SQL Server 2012 SQL improvements (OFFSET, FETCH, etc.)

projects i'm following

No projects being followed.


No forks.