Merged
Conversation
This commit addresses a scaling challenge for CSUP with respect to large numbers of types by arranging for the per-type metadata to be decoded on an as-needed basis. To do so, we changed the metadata representation from a single super value to an array of flattened metadata records indexed by ID. This allows us to incrementally unmarshal and build the shadow vectors fow only the types needed by a query. Additionally, the metadata object filter now performs projection too so that only the metadata values from the types needed are deserialized and acted upon by the metadata filter. These changes affect the CSUP file format so we bumped its version number from 8 to 9. The code that unmarshals the shadow vectors is not currently reentrant. If/when we want to allow concurrent updates (e.g., vcache used by parallel lake requests) we will need to invoke the proper locking protocol. Some rough perf measurements indicate a 5X speedup for the Bluesky Million data set on a simple query projecting a single column.
nwt
approved these changes
Apr 8, 2025
|
|
||
| type Context struct { | ||
| mu sync.Mutex | ||
| local *super.Context // holds the types for the Metadata values |
Member
There was a problem hiding this comment.
Maybe call this sctx for consistency?
Collaborator
Author
There was a problem hiding this comment.
This raises an interesting point. I find it helpful to know it's different than the shared query context (i.e., created locally vs passed in) so that you need to do translations.
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.
This commit addresses a scaling challenge for CSUP with respect to large numbers of types by arranging for the per-type metadata to be decoded on an as-needed basis. To do so, we changed the metadata representation from a single super value to an array of flattened metadata records indexed by ID. This allows us to incrementally unmarshal and build the shadow vectors for only the types needed by a query. Additionally, the metadata object filter now performs projection too so that only the metadata values from the types needed are deserialized and acted upon by the metadata filter.
These changes affect the CSUP file format so we bumped its version number from 8 to 9.
The code that unmarshals the shadow vectors is not currently reentrant. If/when we want to allow concurrent updates (e.g., vcache used by parallel lake requests) we will need to invoke the proper locking protocol.
Some rough perf measurements indicate a 5X speedup for the Bluesky Million data set on a simple query projecting a single column.
Fixes #5550