Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
58da5b9
perf(localfs): zero-copy hard_link fast path for upload_multipart
VibeSWE Nov 30, 2026
2820c2f
perf(storage): zero-allocation FieldStatsAccumulator and bounded thre…
VibeSWE Nov 30, 2026
74fa3a2
perf(ingest): single-snapshot stream admission and zero-clone LogSour…
VibeSWE Nov 30, 2026
a16ec8f
perf(staging): async push queue, pre-encoded group writes, off-lock c…
VibeSWE Nov 30, 2026
3278f9f
Merge commit '58da5b92'; commit '2820c2fc'; commit '74fa3a25'; commit…
VibeSWE Nov 30, 2026
7bb673c
perf(ingest): build record batches from JSON bytes, parse off the worker
VibeSWE Nov 30, 2026
d00d189
perf(staging): parallel pipelined log Parquet conversion
VibeSWE Nov 30, 2026
2fbc8c9
Harden Wave 1/2 staging, LocalFS, journal, and log_source invariants
VibeSWE Nov 30, 2026
d1d66f0
Merge commit '7bb673cd' into t3/investigate-ingest-performance
VibeSWE Nov 30, 2026
7b8711b
Wire single-hop flat ingest, async push_async, and zero-clone admission
VibeSWE Nov 30, 2026
1ea1f15
Merge commit 'd00d1891' into t3/investigate-ingest-performance
VibeSWE Nov 30, 2026
9c174b4
Bound merged reverse reader buffers and verify 1/2-thread log convers…
VibeSWE Nov 30, 2026
8a98bd1
Address Astra, GLM, and DeepSeek post-integration review findings
VibeSWE Nov 30, 2026
02c5e1f
perf(query): parallelize, project, and count-optimize disk-backed sta…
VibeSWE Nov 30, 2026
236290d
Harden projected and parallel staging disk scans per review findings
VibeSWE Nov 30, 2026
891033d
feat(staging): add two-phase filter-first Arrow IPC batch reader
VibeSWE Dec 1, 2026
6b86346
perf(query): optimize staging scans, live-window manifest caching, an…
VibeSWE Dec 1, 2026
1906f19
perf(staging): parallel pipelined clustered log conversion with inlin…
VibeSWE Dec 1, 2026
1281185
perf(query): progressive certified-bounds TopK execution
VibeSWE Dec 1, 2026
ceab0f4
Merge commit '6b86346a'; commit '12811854'; commit '1906f193'; commit…
VibeSWE Dec 1, 2026
3700bb0
Wire timestamp stats, per-file TopK bounds, and two-phase staging IPC…
VibeSWE Dec 1, 2026
54181d8
fix(query): harden progressive TopK planning and execution
VibeSWE Dec 1, 2026
6fe9c03
fix(clustering): bound clustered row-group and inline field-stats memory
VibeSWE Dec 1, 2026
f519901
fix(catalog,query): harden manifest statistics provenance, cache cons…
VibeSWE Dec 1, 2026
2dd9a0e
fix(staging): harden two-phase IPC reader budgets, validation, fallba…
VibeSWE Dec 1, 2026
37226cb
Merge commit '54181d82'; commit '6fe9c03e'; commit '2dd9a0ef'; commit…
VibeSWE Dec 1, 2026
79a9a64
Wire two-phase staging IPC cancellation checks into StagingDiskPartition
VibeSWE Dec 1, 2026
c56936d
query: guard progressive TopK prunability/fetch cap and restore sound…
VibeSWE Dec 1, 2026
163ad95
style(localfs): collapse nested if for clippy -D warnings
VibeSWE Dec 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 58 additions & 16 deletions docs/log-severity-clustering.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,71 @@ different columns; this is fallback selection, not a multi-column sort.

## What changes when enabled

During Arrow-to-Parquet conversion of a log stream, the writer buffers exactly
the rows of one row group (`P_PARQUET_ROW_GROUP_SIZE`, 262,144 by default). It
stably reorders them by the cluster column ascending, then by the stream's time
column (`p_timestamp` or its time partition) descending, with NULLs last in both
keys. The final row group of a file may be partial and is clustered the same way.

- **Row groups contain the same rows as without clustering.** Their time ranges
are therefore unchanged and row-group time pruning is unaffected. Inside a
row group, rows of one severity are contiguous, so page indexes on the
timestamp column are less selective for queries that do not filter severity.
During Arrow-to-Parquet conversion of a log stream, the writer buffers the rows
of one row group (`P_PARQUET_ROW_GROUP_SIZE`, 262,144 by default). It stably
reorders them by the cluster column ascending, then by the stream's time column
(`p_timestamp` or its time partition) descending, with NULLs last in both keys.
The final row group of a file may be partial and is clustered the same way.

A buffered row group is also capped at 128 MiB of Arrow data: rows stop
accumulating into it once its rows reach 128 MiB (each row counted at the data
size per row of the batch it was decoded from), and the next row group starts
there. Only row groups of large rows are affected. At the default row-group size
that means rows averaging more than about 512 bytes. Every other row group holds
exactly the rows it would hold without clustering, and the parallel writer
writes the same bytes as the sequential one.

- **Row groups that are not cut short contain the same rows as without
clustering.** For them, time ranges and row-group time pruning are unchanged.
This holds only while the writer's own `P_PARQUET_ROW_GROUP_BYTES`
(`row_group_bytes`) limit does not split a clustered row group: that limit
applies after clustering, so it splits a group's clustered rows, not its
time-ordered rows. The resulting Parquet row groups each cover a severity
range across the whole group's time span. A group cut short at 128 MiB
covers a shorter time span than the default writer's row group, which
splits its rows by `row_group_bytes` (when set) at different points. In
both cases, row-group time pruning is weaker or different than without
clustering. Inside a row group, rows of one severity are contiguous, so page
indexes on the timestamp column are less selective for queries that do not
filter severity.
- **Schema, values, timestamp units, row counts, manifest statistics** (min/max,
`null_count`), file names, manifests, ingestion acknowledgements and every
HTTP, OTLP, Flight and gRPC request/response format are unchanged.
- **Footer ordering:** clustered files declare no `sorting_columns`, so their
manifest `sort_order_id` is empty. They contain no file-level timestamp order,
and the query engine does not trust footer order claims for any file. Without
clustering, the existing `p_timestamp DESC` claim is still written.
- **Memory:** clustering holds up to one row group of decoded Arrow rows per
file being converted, plus one reordered batch of 8,192 rows at a time.
Rows are gathered from the buffered input in order; neither a concatenated
copy of the row group nor a full reordered copy is built. The existing
writer holds one row group of encoded column data. At most two conversions
run per stream.
- **Memory:** parallel clustered conversion pipelines bounded waves of row groups
on `LOG_CONVERSION_THREADPOOL`, gathering and encoding each column independently
in 8,192-row chunks without building a full reordered copy of the row group.
The writer bounds memory with schema estimates and with the measured size of
the rows it reads:
- Row groups whose schema floor estimate is above 64 MiB drop to one group per
wave.
- Row groups whose schema estimate is above 128 MiB (e.g., wide schemas under
churn) fall back to the sequential writer, which holds a single row group at
a time.
- Whatever the estimate, a row group stops taking rows at 128 MiB of actual
Arrow data, so a group of 2 KiB string payloads holds about 65,000 rows
instead of 512 MiB.
- Once a row group's decoded rows retain more than 64 MiB of allocations
(measured from the buffers the rows keep alive, each counted once), the rest
of the file is read, clustered, encoded and appended one row group at a time,
with no read-ahead or overlap.
- When the writer's byte limit splits one clustered row group, later row
groups of the file go straight to the split-aware encoder instead of being
encoded twice.

At most two conversions run per stream.
- **Field statistics:** dataset statistics (`P_COLLECT_DATASET_STATS`) are counted
inline from the rows as they are read, in source order. A clustered file's
rows are stored in another order, so the inline counts are kept only while
they are exact and small. The writer drops them, releasing their values, as
soon as any field sees more distinct values than it tracks (at least 1,024).
Past that point its top values depend on counting order. It also drops them
when the tracked values exceed 16 MiB for the file. The upload path then
computes the statistics from the written file. Cached statistics waiting for
upload are capped at 16 MiB per file and 64 MiB in total.

## When clustering is skipped

Expand Down
Loading
Loading