Repository navigation
perf(db): deserialize only selected nested property values - #1324
Open
perfloop-agent wants to merge 2 commits into
Open
perfloop-agent wants to merge 2 commits into
perfloop-agent wants to merge 2 commits into
Conversation
Signed-off-by: Perfloop Agent <agent@perfloop.ai>
Signed-off-by: Perfloop Agent <agent@perfloop.ai>
This branch has not been deployed
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.
Nested Values projections deserialize parent objects to return scalars, including sibling strings, arrays and maps the caller did not select. This change walks the validated archive and deserializes the selected value instead.
Exact stored dotted names still win. Duplicate root names, missing paths and non-object intermediates keep their behavior. The walk uses the full decoder's map visitor, including for validated maps with absent child links or duplicate or out-of-order keys. Record loading, full-record validation and the stored format are unchanged.
Local paired release measurements include complete warm-memory query execution, storage access, validation, output construction and result destruction:
Production frequency and cold-storage costs remain unmeasured.
crates/db/benches/projection_materialization/nested.rsadds native cases for small metadata and a large unused string sibling. Native measurement command:cargo bench --locked -p db --bench projection_materialization -- nested --sample-count 3 --min-time 0.02.Tests
Cargo's focused property-row, resolver and projection checks passed 18 library tests and 1 public-query integration test, with 0 failures or ignored tests. They cover decoder equivalence, name precedence, alignment, corruption, absent map children and lazy errors. Divan's nested projection smoke fixtures completed; scoped Clippy and formatting checks passed.
Case and evidence
Made by Perfloop. Human sponsor: Tomás Senart.


The PR appears safe to merge; no actionable issues were found.Summary
Nested property reads now walk the validated archive and deserialize only the selected value.
No actionable issues were found. Tests were inspected but not run during this review.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Validated property row] --> B{Exact stored name?} B -->|Yes| E[Deserialize selected value] B -->|No| C[Find first root property] C --> D[Visit each nested object] D -->|Path found| E D -->|Missing or non-object| F[Return no value]Reviews (1) · Last reviewed commit: "fix(db): follow the decoder traversal fo..." · Reviewed by Greptile