-
Notifications
You must be signed in to change notification settings - Fork 177
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
feat(1231): Basic query cardinality estimation #1273
Conversation
1cf2ea2
to
401a7a5
Compare
@joshua-spacetime Since you are rather busy, I took the liberty of applying my suggestions myself. They simplified things, especially the tests, quite a bit. If you are as well, I am happy to merge the PR now, and the range stuff we can defer to a different PR (although feel free to comment on that,...). |
use crate::db::relational_db::Tx; | ||
use spacetimedb_primitives::{ColList, TableId}; | ||
use spacetimedb_vm::expr::{Query, QueryExpr, SourceExpr}; | ||
|
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.
The way this is written is to me not estimated number of rows
but MAXIMUM estimated number of rows
.
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.
This is true, although the plan is that this will become more accurate over time as we add more stats.
This patch implements basic cardinality estimation for QueryExpr. It utilizes table cardinalities and number of distinct values for index related operators.
36b29e9
to
7b3509a
Compare
Description of Changes
This patch implements basic cardinality estimation for QueryExpr. It utilizes table cardinalities and number of distinct values for index related operators.
API and ABI breaking changes
None
Expected complexity level and risk
1
Testing
Tests are added.