Repository navigation
perf(next): advanced cost-based join ordering with real in-memory index statistics - #644
Merged
remiceres merged 2 commits intoOct 22, 2026
Merged
Conversation
…ex statistics - Add PredicateStatistics record to storage API model - Provide POS-index based distinct subjects and objects extraction in TripleIndex - Expose predicate statistics via MetadataOperations and IndexedStatementStore - Integrate index statistics into QueryStatistics and StorageManagerProducer - Upgrade CardinalityPatternOrdering to use real selectivity ratios from index stats - Refactor ordering methods with PlanningContext to ensure 0 Sonar alerts - Add tests in CardinalityQueryPlannerTest covering index-driven join ordering Closes #637
|
Test Results 416 files 416 suites 26s ⏱️ Results for commit 92e5c22. |
…r cache - Fix distinct subjects extrapolation formula in TripleIndex - Guard against long arithmetic overflow using BigDecimal in CardinalityPatternOrdering - Safely handle invalid IRI strings in toPredicateIri - Make StorageManagerProducer thread-safe and cache missing predicate stats - Handle StorageException gracefully during statistics inspection
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves #637 by replacing the heuristic static reduction scales in
CardinalityPatternOrderingwith exact and sampled index statistics extracted directly fromInMemoryStatementStore(distinctSubjectsanddistinctObjects).Technical Changes
Storage API & Model:
PredicateStatisticsrecord (IRI predicate,long count,long distinctSubjects,long distinctObjects) infr.inria.corese.core.next.storage.api.model.default PredicateStatistics getPredicateStatistics(IRI predicate)toMetadataOperations.InMemoryStatementStore Implementation:
estimatePredicateStatistics(IRI, maxSample)inTripleIndexleveraging thePOSindex permutation (PredicateSampleAccumulator).getPredicateStatistics(IRI)inIndexedStatementStoreaggregating across partitions.Query Engine SPI & Producer:
getPredicateStatistics(Query, Node, IRI)andgetStorageStatistics()toQueryStatisticsinterface.StorageManagerProducerwith safety guards for mocked storages.Cost-Based Query Planner (
CardinalityPatternOrdering):PlanningContextto maintain strict compliance with SonarLint cognitive complexity and parameter count thresholds.Unit Tests & Quality:
CardinalityQueryPlannerTestverifying join ordering decisions driven by distinct subjects/objects, exact statistics extraction, and Cartesian explosion avoidance.core.next.