Skip to content

[pull] main from MaterializeInc:main - #1420

Merged
pull[bot] merged 3 commits into
transparencies:mainfrom
MaterializeInc:main
Sep 30, 2026
Merged

pull[bot] merged 3 commits into
transparencies:mainfrom
MaterializeInc:main

Conversation

@pull

@pull pull Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

github-actions Bot and others added 3 commits September 30, 2026 09:04
## Summary

Automated daily refresh of `doc/developer/generated/` to reflect source
code changes.

This PR was generated by the `update-generated-docs` workflow running
`.claude/commands/update-docs.md`.

## Scope

Only files under `doc/developer/generated/` are modified.

## Review checklist

- [ ] No unrelated rewording or restructuring of existing text
- [ ] No changelog language ("now", "added", "previously", etc.)
- [ ] Changes correspond to actual source code changes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
### Motivation

A materialized view or index that computes `MIN` or `MAX` over an input
with updates or deletes kept an extra copy of its input in memory. The
first stage of the hierarchical reduction arranged every input row,
where it should arrange only the rows its buckets reject. With the
default bucketing almost every row wins its first-stage bucket, so that
arrangement should be nearly empty.

For a `MAX` over 100,000 rows in 1,000 groups:

| | before | after |
|---|---|---|
| first-stage reduction, default bucketing | 100,000 records, 4.00 MB |
0 records |
| all arrangements of the view, default bucketing | 16.8 MB | 12.8 MB |
| first-stage reduction, `AGGREGATE INPUT GROUP SIZE = 100` | 100,000
records, 4.25 MB | 84,017 records, 2.84 MB |
| all arrangements of the view, `AGGREGATE INPUT GROUP SIZE = 100` | 5.4
MB | 3.9 MB |

The saving applies where a bucket's winner is one of its input rows,
which holds for a single `MIN` or `MAX`. `ReduceReduction` keeps all
hierarchical aggregates of a `Reduce` in one hierarchy, so for `MIN(a),
MAX(b)` the winner combines values from different rows, matches no input
row, and the stage arranges its input as before the change.

### Description

Each stage maintains, as its reduction's output, its winners minus its
input, and emits `input + output`, which is the winners alone. The
reduction pushed each winner with `Diff::MINUS_ONE`, so a stage emitted
its winners at -1, and the first stage's reduction held the winner at -2
and every other row at -1. Later stages, fed -1 inputs, still held only
their rejected rows, which is why only the first stage grew. The sign
has been off since #27085 moved the negation of the inputs into the
reduction.

Results were unaffected: min and max count each row once whatever its
multiplicity, and no check reads a stage's output. The first stage
validates its raw input, and the final `ReduceMinsMaxes` check runs only
when there are no stages.

The winner is now emitted with `Diff::ONE`, so stages emit their winners
at +1 and a winning input row cancels against itself in its stage's
arrangement. TopK's corresponding stage, `build_topk_negated_stage`,
already uses this sign.

### Verification

Adds a section to `test/testdrive/introspection-sources.td`: a `MAX`
over 1,000 groups of one row each. Every row wins its bucket at every
stage however the rows hash, so the test asserts that no stage's
reduction arranges a record. Without this change the first stage holds
all 1,000 rows. A second view computes `MIN(v), MAX(v)` over the same
table to cover value rows with one column per aggregate, where the
winner of a single-row group still equals its input.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Moritz Hoffmann <antiguru@gmail.com>
Nightly release builds on x86_64 and aarch64 fail since #39339 bumped
tikv-jemalloc-sys to 0.7.1 (jemalloc 5.3.1). jemalloc's configure aborts
with `cannot determine return type of strerror_r`.

jemalloc 5.3.1 runs its `strerror_r` link checks with `-Werror`. The
release LDFLAGS contain `-static-libstdc++`, which clang reports as
unused when linking a C program, so both checks fail. This change adds
`-Wno-unused-command-line-argument` to the release LDFLAGS. Running
configure in the ci-builder image with clang-22 and the nightly's flags
reproduces the failure, and with this flag configure succeeds and
detects `JEMALLOC_STRERROR_R_RETURNS_CHAR_WITH_GNU_SOURCE`.

Posted by Claude Code.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@pull pull Bot locked and limited conversation to collaborators Sep 30, 2026
@pull pull Bot added the ⤵️ pull label Sep 30, 2026
@pull
pull Bot merged commit da730eb into transparencies:main Sep 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants