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
{{ message }}
Repository navigation
[Feature]: efficient branch-head reads for root elements, related relationships and queries #416
I have verified that I am running the latest version of the SysML2.NET
I have searched open and closed issues to ensure it has not already been reported
Description
The schema is designed for fast reads of each branch's latest state. Three PIM read operations still cost O(model) per call at a branch head (query shapes from schema.smoke.sql; not benchmarked):
getRootElements: reads the whole overlay plus checkpoint, then filters on derived_version.owner IS NULL. Nothing finds roots directly.
getRelationshipsByRelatedElement: no function provides the cheap path (reverse index ix_relationship_source_target / ix_relationship_target_target, then keep only versions current at the head), and the smoke script resolves the full snapshot instead.
executeQuery / executeQueryById: the vw_* views cover every version in history rather than the branch head, and only class_kind, owning_relationship, owner and qualified_name are indexed.
Reads at historical commits are slower by design and are out of scope.
Fix:
Add a root flag to branch_head and commit_checkpoint, with a partial index on it.
Add a branch-head relationships function built on the reverse indexes.
Add branch-head-scoped views or query helpers.
Add a case for each to SqlSchemaBenchmarkTestFixture.
Steps to Reproduce
Not applicable (performance feature). See the ROOTS and REVERSE-RELATIONSHIP scenarios in SysML2.NET.CodeGenerator.Tests/Sql/schema.smoke.sql.
Activity