I built an Entity Framework (v1) model which includes inheritance, like this:
Base class: Issue
<- Complaint
<- CustomerQuery etc. (6 derived classes)
These classes map to corresponding tables in SQL Server.
I was impressed with the way that I could then use LINQ to entities to do creation - EF figures out that it must put some data in one table, get the identity key value and use it in the other table.
BUT: When I do a simple query such as the following
var result = dataContext.IssueSet.Where(x => x.Id == id);
... the ToTraceString reveals SQL code over 1000 lines long! And it performs awefully.
Do you think it is likely that I've done something wrong in my model or is the huge SQL code characteristic of inheritance structures in L2E?
P.S. Here's the beginning of the SQL trace string for info:
SELECT
1 AS [C1],
CASE WHEN (( NOT (([UnionAll8].[C45] = 1) AND ([UnionAll8].[C45] IS NOT NULL)))
AND ( NOT (([UnionAll8].[C46] = 1) AND ([UnionAll8].[C46] IS NOT NULL)))
AND ( NOT (([UnionAll8].[C47] = 1) AND ([UnionAll8].[C47] IS NOT NULL)))
AND ( NOT (([UnionAll8].[C48] = 1) AND ([UnionAll8].[C48] IS NOT NULL)))
AND ( NOT (([UnionAll8].[C49] = 1) AND ([UnionAll8].[C49] IS NOT NULL)))
AND ( NOT (([UnionAll8].[C50] = 1) AND ([UnionAll8].[C50] IS NOT NULL)))
AND ( NOT (([UnionAll8].[C51] = 1) AND ([UnionAll8].[C51] IS NOT NULL)))
AND ( NOT