-
Notifications
You must be signed in to change notification settings - Fork 664
Cache whether a Table is a scheduler table, avoiding fetching the schema
#2141
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
bc2a869 to
f388240
Compare
52dc83b to
91fe2fb
Compare
f388240 to
a1aeb6c
Compare
91fe2fb to
698b526
Compare
|
Why are we returning this per insert when we can know whether or not the table we're inserting into is a scheduled table a piori? |
Semantically, we can check after or before. The previous code did check after, but it is unfortunately slower, as it incurs another |
cloutiertyler
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.
Ack, I approve the changes to traits.rs. Please get a full review from the primary reviewer.
gefjon
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.
- Why is
InsertFlagsa distinct type fromUpdateFlags? - Now that we've got
insertandupdatereturning a 3-tuple, is it time to switch it to a struct with named fields?
gefjon
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.
Approved, pending TODO comments to the effect of my earlier questions.
698b526 to
209e4ae
Compare
209e4ae to
5f6b3ae
Compare
Description of Changes
Fixes #2021.
Does 2 things:
fn {insert,update}_mut_txtotraits.rsto return whether the table was a scheduler table.Table::is_schedulersodatastore_{insert, update}_bsatndon't have to fetch the schema.Perf before:
Perf after:
This means we go from an average 653 ms to 630 ms, which is about an average 23 ms speedup.
This was the expected speedup based on % of samples in the update ABI PR flamegraph.
API and ABI breaking changes
None
Expected complexity level and risk
1, fairly simple and contained change.
Testing
A test of the caching behavior is added in
datastore.rs:fn test_scheduled_table_insert_and_update.