-
Notifications
You must be signed in to change notification settings - Fork 25
Add query optimization and explain API #1136
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
Conversation
- Implemented `explain` function to return query execution plans. - Added `optimize-query` function to reorder query patterns based on selectivity. - Introduced `Optimizable` protocol for query optimization. - Created integration tests for explain functionality and optimization behavior. - Added unit tests for pattern recognition and boundary splitting in optimization.
dpetran
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to see tests with more unoptimizable patterns with nested clauses: optional, union, subquery, etc.
|
I was looking at how to reconcile this I think they're quite complementary - if you're familiar with Postgres, this work corresponds to the This one doesn't yet have support for nested clauses, and I think we could integrate the two approaches without too much trouble. And I'd be happy to pick this up and finish it, depending on your availability. |
…n for improved readability
…r improved clarity in user-value conversion
… reporting for unexpected types
…ved clarity and consistency
…rove selectivity calculation logic
Please do! The main purpose of including this is to see how the query got reordered for an end-user, but I'm sure there is lots more value we can bring. The upstream branch includes detailed statistics on each property to explain the state of the data and why it was reordered, so you should at least use that as the baseline for any future work here. |
|
Closing because all work was done on upstream branch which is based off this branch. |
Summary
Implements query pattern optimization based on property and class statistics. Adds
explainAPI to show optimization decisions without executing queries.Key Features
Query Optimization
Explain API
fluree.db.api/explainfunctionSelectivity Scoring
Implementation
Protocol-based Design
Optimizableprotocol for FlakeDB, AsyncDB, DatasetQuery Integration
Test Coverage
315 new assertions across 5 integration tests:
All tests pass (290 tests, 2142 assertions).