Repository navigation
Conversation
Tests for selecting series by a Scan's label predicates (label = 'v', IN, OR of = on one label) in raw reads: recognition and its negative cases, the label index, per-chunk selection and skipping, shared conversions kept apart by selection, series partition composition, and an end-to-end intent round answering the same with and without pushdown while reading only the bound host's rows. Stubs keep today's behaviour; RawData::read returns RawRead with rows in the time range. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es select A raw read recognizes, among its Scan's predicates, label = 'v', label IN (...) and an OR of = on one label, on label columns (a SQL table's text columns, a metric's labels), and returns only the rows of the series they select; everything else is still applied by the executor, so the answers do not change. Per read, each series is judged once (a verdict by dense series id); per chunk, its distinct series are checked, a chunk with none selected is skipped without touching its rows, and the selected rows are copied in one pass (Chunk::select, which Chunk::in_partition now uses). A selected cut of a stored chunk is converted once per range request and selection, apart from the whole chunk's conversion. /metrics counts the query runs' raw reads, their rows in the time range and the rows returned (asap_query_raw_read_*_total). --no-label-pushdown (EngineOptions::label_pushdown) reads every series, for comparison. No global label index: the per-chunk check walks each chunk's series list either way (rows are in arrival order). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hunk dictionary fields A table may declare its series key (--table-layouts): a row's series is its key labels, its other labels are fields stored as dictionary-coded columns of the chunk. Sealed keyed panes are sorted by series then time; key-label columns are dictionaries over the chunk's series codes and are built once per chunk (cached across rounds); label pushdown applies key restrictions to series and field restrictions to dictionary entries. Metrics and tables without a layout keep one series per label set. N1 5-min (synthetic x1, 6.6 M rows): round 12.5 s -> 0.56 s, series 5.07 M -> 520, peak RSS 7.8 GB -> 1.9 GB, answers identical. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6boFpwkpMtRc1FnZuYi
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.
Why
A SQL table is stored as series: each row is a sample of the series named by all its text columns. Event data (network packets) almost never repeats a label set, so every row becomes its own series: N1 on packets holds millions of series per 5 minutes. Each row then pays for interning a label map, per-round text-column builds, and a series table that never shrinks. Profile in the network eval: ~42% of q1 in
Chunk::column, ~94% of decode in series interning, peak RSS 4.5 GB for 283 MB of raw rows.What
A table can declare its series key (deployment config,
--table-layouts FILE):{"packets": {"series_key": ["src_p16"]}}A row's series is then
{__name__=<table>, <key columns>}. Every other column is a field: a typed column inside the series' chunks (text fields are dictionary-coded per chunk). Metrics and tables without a layout are stored as before. The planner is unchanged: it already treats a SQL table as columns.Before / after (N1 5-minute intent, synthetic x1, 6.6 M rows, in-process
packets_bench, 16 threads)packetskeyed bysrc_p161-hour N1 (72.6 M rows of [0, 3630 s), keyed by
src_p16, 629 series):How
table_layout.rs(new):TableLayouts(--table-layouts,EngineOptions::table_layouts,Limits::table_layouts) andsplit: a row's labels -> (series key, fields).RawSample::fields, sorted by name, with names interned once. These rows are not put in the per-thread label-bytes cache, which today keeps every row-series.store::Chunk:fields: per-chunk dictionary text columns.built), so a sealed pane's columns are built once in its life, not once per round. Compaction and eviction drop chunks together with their cached columns.ahashis used for the store's internal maps.asap_series_interned. Push precompute mode with--table-layoutsis refused: push pipelines do not carry fields.examples/packets_bench.rs: feeds anet_dumppacket file as the eval's feeder does, runs an intent's rounds, and prints ingest CPU per row, raw bytes, series interned, RSS and per-query latency. It writes answers for comparing layouts.Tests
table_layout: parse, refuse, split.remote_write: one series per key value, fields carried, a missing key label.store: a keyed read returns the same rows as the label layout; sealed panes are sorted; dictionary sizes; columns built once across runs; cached bytes counted and following compaction and eviction; pushdown on key and field columns.intent_sil_modes::keyed_table_answers_equal_the_label_layout_and_exact, in all three planning modes, for keys[host],[host, user]and[user]:cargo test -p data_plane --no-fail-fastpasses.Deferred
valueis the Float64 field.Scanreads.🤖 Generated with Claude Code
https://claude.ai/code/session_01K1M6boFpwkpMtRc1FnZuYi