-
Notifications
You must be signed in to change notification settings - Fork 646
Materialize views for sql http calls #3586
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
base: master
Are you sure you want to change the base?
Conversation
0e43a96 to
8168623
Compare
last_called timestamp in st_view_sub for sql queries657d86b to
3c5530b
Compare
3c5530b to
eadfc38
Compare
| use spacetimedb_schema::schema::{Schema, TableSchema}; | ||
| use spacetimedb_vm::relation::RelValue; | ||
| use std::collections::VecDeque; | ||
| use std::collections::{HashSet, VecDeque}; |
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 shouldn't use HashSet from libstd.
| @@ -1,10 +1,28 @@ | |||
| use std::sync::Arc; | |||
| use std::{collections::HashSet, sync::Arc}; | |||
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.
ditto
| self.visit(&mut |plan| match plan { | ||
| Self::TableScan(scan, _) => { | ||
| if let Some(info) = &scan.schema.view_info { | ||
| views.insert(info.view_id); | ||
| } | ||
| } | ||
| Self::IxScan(scan, _) => { | ||
| if let Some(info) = &scan.schema.view_info { | ||
| views.insert(info.view_id); | ||
| } | ||
| } | ||
| Self::IxJoin(join, _) => { | ||
| if let Some(info) = &join.rhs.view_info { | ||
| views.insert(info.view_id); | ||
| } | ||
| } | ||
| _ => {} | ||
| }); |
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.
| self.visit(&mut |plan| match plan { | |
| Self::TableScan(scan, _) => { | |
| if let Some(info) = &scan.schema.view_info { | |
| views.insert(info.view_id); | |
| } | |
| } | |
| Self::IxScan(scan, _) => { | |
| if let Some(info) = &scan.schema.view_info { | |
| views.insert(info.view_id); | |
| } | |
| } | |
| Self::IxJoin(join, _) => { | |
| if let Some(info) = &join.rhs.view_info { | |
| views.insert(info.view_id); | |
| } | |
| } | |
| _ => {} | |
| }); | |
| self.visit(&mut |plan| { | |
| let view_info = match plan { | |
| Self::TableScan(scan, _) => &scan.schema.view_info, | |
| Self::IxScan(scan, _) => &scan.schema.view_info, | |
| Self::IxJoin(join, _) => &join.rhs.view_info, | |
| _ => return, | |
| }; | |
| if let Some(info) = view_info { | |
| views.insert(info.view_id); | |
| } | |
| }); |
Description of Changes
Materialize views if necessary for sql queries. Also update the subscriber count and
last_calledtimestamp inst_view_sub.API and ABI breaking changes
None
Expected complexity level and risk
1
Testing
TODO