Repository navigation
Conversation
…ilter Guard for judging a keyed table's field restriction once per series per read rather than once per series per chunk: 2,000 series over 6 panes, field-only, key-and-field and key-only restrictions, with and without the read cache, equal a plain filter. Passes before and after the change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6bpWvKMxYBvtAgpDYGp
…elds by bitmask A read's label selection judged each series once, but a series lacking a restricted label (a keyed table's field, e.g. login_fail's src under series_key [user]) was re-checked on every chunk by name: one series label lookup and one field lookup per restricted label, per series, per chunk. The verdict now keeps the lacking labels as a bitmask, and each chunk computes once which restricted labels it holds as fields; a series is then one mask test per chunk. Same selection. SB q3 at x4 (count distinct user by target over 1 h of login_fail where src IN $A): 11.9 -> 10.5 s p50. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6bpWvKMxYBvtAgpDYGp
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.
Summary
q3runs is late:count(DISTINCT user) … FROM login_fail WHERE src IN $SB_Aover 1 h takes 11–13 s. The deployment keyslogin_failbyuser, sosrcis a field. The read's label selection judged each series once, but it re-checked a series that lacks a restricted label on every chunk, by name: a series label lookup and a field lookup per restricted label, per series, per chunk. In the profile,SeriesVerdicts::keepswas 27.5% self time plus 18%memcmp.q3at x4 goes from 11.9 to 10.5 s p50 (11.0 s p99). Answers are unchanged (golden check). This alone does not make the SB rounds on time: the rest ofq3is the exact distinct aggregation over the rows the IN-list keeps, plus the scan's column builds.Review guide
eval/2026-12-backendf13d85b (eval build 5). Readdata_plane/src/store.rs:SeriesVerdicts::{field_mask, keeps}andChunk::select_by. Check the bit-63 rule for selections of more than 63 labels.Behavior: before → after
SB.c4r4h2
intent_full(build-4/5 plan), 1 h of history, 30 rounds at 10 s, started while the hotlogin_failepisode is in the 10 min window, soq3runs in every round that runs. Data plane on 48 threads of a 56-thread host,--precompute-mode window --table-layouts layouts.json:Interfaces
data_plane/src/store.rsstruct SeriesVerdicts { selection: Arc<LabelSelection>, by_id: std::cell::RefCell<Vec<u8>>, + /// By series id, for verdict 3: the restricted labels it lacks, one bit + /// per label in the selection's order. + lacks_by_id: std::cell::RefCell<Vec<u64>>, } impl SeriesVerdicts { + /// The restricted labels a chunk holds as fields; judged once per chunk. + fn field_mask(&self, is_field: impl Fn(&str) -> bool) -> u64; - fn keeps(&self, series: &Series, is_field: impl Fn(&str) -> bool) -> bool; + fn keeps(&self, series: &Series, fields: u64) -> bool; }Usage (end to end): a query-time
Scanoflogin_failundersrc IN $SB_AcallsRawData::read, which builds oneSeriesVerdictsper read. For each chunk in the time range,Chunk::select_bycomputesfield_mask(srcis a field), keeps each series bykeeps(series, fields), and cuts the rows whosesrcdictionary entry is allowed. The executor then aggregates the kept rows.Tests
data_planestore::unit tests: 22 passed. The newfield_restrictions_on_many_series_match_a_plain_filter(2,000 series over 6 panes, field-only, key-and-field and key-only restrictions) passes before and after the change.label_pushdown_ingestionpasses.🤖 Generated with Claude Code
https://claude.ai/code/session_01K1M6bpWvKMxYBvtAgpDYGp