-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query: Optimize usage of GetViewOrTableMappings #23572
Labels
area-query
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
type-enhancement
Milestone
Comments
This is needed for TPC: #3170 |
ajcvickers
added
punted-for-7.0
Originally planned for the EF Core 7.0 (EF7) release, but moved out due to resource constraints.
and removed
propose-punt
labels
Apr 23, 2022
smitpatel
added
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
and removed
punted-for-7.0
Originally planned for the EF Core 7.0 (EF7) release, but moved out due to resource constraints.
labels
May 12, 2022
smitpatel
added a commit
that referenced
this issue
May 13, 2022
Resolves #23572 Following rules define if given entity type is a potential candidate for optional dependent in table sharing case - A keyless entity cannot be in table sharing - Only root type of hierarchy can be dependent - The dependent can be TPH/TPT (or no hierarchy) but no TPC - Principal can be any type except non-leaf type in TPC (this is only applied in model validation, no impact on query) If above conditions indicate it is optional dependent then we need to find the ITableBase it is mapped to find if it is optional dependent We find ITableBase for IEntityType (which is also root type) - For new generated SelectExpression, first table's ITableBase is the mapping table (regardless of type of TableExpressionBase, if no mapping then we use default) - For other scenario the single mapped view/table mapping for the entity type (because of root type, there will only be one mapping) or default mapping in case entity type is not mapped to any view/table Once we get table and verify it is optional dependent, We use required non-PK columns which are not shared with principal entity types to add check for existence. This is necessary and sufficient condition for existence
smitpatel
added a commit
that referenced
this issue
May 13, 2022
Resolves #23572 Following rules define if given entity type is a potential candidate for optional dependent in table sharing case - A keyless entity cannot be in table sharing - Only root type of hierarchy can be dependent - The dependent can be TPH/TPT (or no hierarchy) but no TPC - Principal can be any type except non-leaf type in TPC (this is only applied in model validation, no impact on query) If above conditions indicate it is optional dependent then we need to find the ITableBase it is mapped to find if it is optional dependent We find ITableBase for IEntityType (which is also root type) - For new generated SelectExpression, first table's ITableBase is the mapping table (regardless of type of TableExpressionBase, if no mapping then we use default) - For other scenario the single mapped view/table mapping for the entity type (because of root type, there will only be one mapping) or default mapping in case entity type is not mapped to any view/table Once we get table and verify it is optional dependent, We use required non-PK columns which are not shared with principal entity types to add check for existence. This is necessary and sufficient condition for existence
smitpatel
added a commit
that referenced
this issue
May 13, 2022
Resolves #23572 Following rules define if given entity type is a potential candidate for optional dependent in table sharing case - A keyless entity cannot be in table sharing - Only root type of hierarchy can be dependent - The dependent can be TPH/TPT (or no hierarchy) but no TPC - Principal can be any type except non-leaf type in TPC (this is only applied in model validation, no impact on query) If above conditions indicate it is optional dependent then we need to find the ITableBase it is mapped to find if it is optional dependent We find ITableBase for IEntityType (which is also root type) - For new generated SelectExpression, first table's ITableBase is the mapping table (regardless of type of TableExpressionBase, if no mapping then we use default) - For other scenario the single mapped view/table mapping for the entity type (because of root type, there will only be one mapping) or default mapping in case entity type is not mapped to any view/table Once we get table and verify it is optional dependent, We use required non-PK columns which are not shared with principal entity types to add check for existence. This is necessary and sufficient condition for existence
ghost
pushed a commit
that referenced
this issue
May 13, 2022
Resolves #23572 Following rules define if given entity type is a potential candidate for optional dependent in table sharing case - A keyless entity cannot be in table sharing - Only root type of hierarchy can be dependent - The dependent can be TPH/TPT (or no hierarchy) but no TPC - Principal can be any type except non-leaf type in TPC (this is only applied in model validation, no impact on query) If above conditions indicate it is optional dependent then we need to find the ITableBase it is mapped to find if it is optional dependent We find ITableBase for IEntityType (which is also root type) - For new generated SelectExpression, first table's ITableBase is the mapping table (regardless of type of TableExpressionBase, if no mapping then we use default) - For other scenario the single mapped view/table mapping for the entity type (because of root type, there will only be one mapping) or default mapping in case entity type is not mapped to any view/table Once we get table and verify it is optional dependent, We use required non-PK columns which are not shared with principal entity types to add check for existence. This is necessary and sufficient condition for existence
This issue was closed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area-query
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
type-enhancement
We also have TableExpression.ITableBase available so some of above can be optimized by just looking at it.
Filed from discussions with @AndriySvyryd
The text was updated successfully, but these errors were encountered: