Skip to content

docs: document dictionary compression - #38024

Merged
maheshwarip merged 17 commits into
mainfrom
docs/dictionary-compression
Aug 14, 2026
Merged

maheshwarip merged 17 commits into
mainfrom
docs/dictionary-compression

Conversation

@claude

@claude claude Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Dov Alperin · Slack thread

Motivation

Arrangement dictionary compression has no user-facing documentation. The feature
is opted into with the EXPERIMENTAL ARRANGEMENT COMPRESSION cluster option, but
there is nothing a field engineer or customer can read to understand what it
does, when it helps, and what it costs. The option was also undocumented in the
SQL reference, so it was not discoverable from CREATE CLUSTER or
ALTER CLUSTER.

Description

One guide, two reference pages, and shared content between them.

  • doc/user/content/transform-data/dictionary-compression.md (new) is the
    guide: what the feature is, how to turn it on, the tradeoff, and how to
    observe the effect.

  • doc/user/content/sql/create-cluster.md and
    doc/user/content/sql/alter-cluster.md now document the option. The option
    appears in the syntax blocks and option tables
    (doc/user/data/examples/create_cluster.yml,
    doc/user/data/examples/alter_cluster.yml, both the SET and RESET
    forms), and each page gets a short Dictionary compression section. These
    sections are deliberately brief and link to the guide for the full tradeoff.

  • doc/user/content/headless/dictionary-compression/ holds the prose that
    would otherwise be repeated across the three pages:

    Fragment Used on
    overview.md — what dictionary compression is, the introducing version, the warn-if-unreleased banner, and the off-by-default opt-in guide, CREATE CLUSTER, ALTER CLUSTER
    tradeoff-summary.md — condensed tradeoff plus the pointer to the guide CREATE CLUSTER, ALTER CLUSTER
    replica-replacement.md — the replica-replacement warning for changing the option guide, ALTER CLUSTER

    This follows the existing content/headless/ + include-headless
    convention already used for cluster-hydration-burst,
    cluster-size-disclaimer, and the sql-command-privileges fragments.

    There were four fragments earlier in review. availability.md is gone,
    folded into overview.md in bd734d2: Kay Kim pointed out that its "public
    preview" sentence duplicated the public-preview shortcode that all three
    including pages already render, and that what was left was a banner plus two
    sentences included on exactly the same three pages, always directly next to
    the overview.

Version. Dictionary compression is available starting in v26.38, which
is Pranshu Maheshwari's call on the thread (2026-08-14), applied in c064c22. The
version appears in five places and they agree: the opening sentence of
overview.md and the {{< warn-if-unreleased "v26.38" >}} banner above it,
plus three warn-if-unreleased-inline calls in the option tables
(create_cluster.yml once, alter_cluster.yml for both the SET and the
RESET form). Per doc/user/README.md, every "Unreleased" banner clears at
once when v26.38 deploys. releases/v26.38.md exists on main as
released: false with date: 2026-08-19, so all five render today.

Placement of the guide (please move if wrong). It sits under Transform
data
, as a sibling of Query optimization (weight: 35). Reasoning: it is
fundamentally an arrangement-memory-reduction technique, and Query optimization
is the closest existing page on reducing memory. The plausible alternative is
content/manage/ next to Operational guidelines, since turning the option
on reprovisions the cluster's replicas. Happy for this to move.

Content decisions on the guide.

  • Opens with one plain-language paragraph on what dictionary compression is. No
    row-codec internals appear anywhere on the page (no tags, byte values, encoding
    scheme, or internal type names).
  • The tradeoff is the largest section, and it is split into When it helps
    and When it does not help (Pranshu Maheshwari's wording). High cardinality
    leads "When it does not help": the page states that Materialize does not
    detect a high-cardinality column and skip it up front, so a near-unique column
    pays the full CPU cost for little or no memory benefit. Per Kay Kim, the
    no-benefit claims are hedged as "little or no" rather than absolute, since a
    near-unique column can still see a minor saving.
  • Per column is the mechanism, per cluster is the control. Moritz Hoffmann
    asked what happens when an arrangement mixes columns that compress well with
    columns that do not, and Kay Kim then caught that the first answer collided
    with the intro's per-column sentence. Both were reworded so neither reads as
    denying the other. The intro says Materialize applies compression per column
    and decides which columns to compress, so a wide row can have one column
    compressed and the rest untouched. A note at the top of "The tradeoff" says
    a single arrangement usually holds both kinds of column, only the compressible
    ones save memory, every column still pays the CPU cost, and you cannot select
    the columns yourself, because you turn compression on per cluster and the
    optimizer chooses which intermediate arrangements a dataflow builds.
  • Distinct values are described as behavior, not prescribed as capacity. Per
    Moritz Hoffmann's correction on the thread, the section is titled "How distinct
    values affect the benefit" and describes the memory benefit as largest when a
    column repeats a small set of values, tapering off as the number of distinct
    values grows past roughly 64, and becoming bookkeeping overhead that buys no
    memory saving once there are enough distinct values. It then says "This is not
    a limit. Nothing breaks when a column holds more distinct values than that,"
    and leaves the reader to draw the conclusion rather than telling them what a
    column should hold. No supported capacity, no "up to N", no exact figure
    presented as a contract.
  • Enablement is documented as one knob: the cluster option. Per Moritz
    Hoffmann's review, the environment-wide dyncfg will default on, so from a
    user's point of view the only setting that matters is EXPERIMENTAL ARRANGEMENT COMPRESSION on a cluster. The pages do not name the internal parameter at
    all, since naming a non-user-settable dyncfg invites support tickets. The
    option itself still defaults to off, and the pages still say so.
  • Only cluster-level syntax is documented. Also per review, the
    CREATE CLUSTER REPLICA form is gone, along with all per-replica framing,
    because that path only applies to unmanaged clusters and those are test-only.
    The reference option tables do note "Only available on managed clusters,"
    matching test/sqllogictest/managed_cluster.slt:446 and the wording already
    used for AUTO SCALING STRATEGY. The guide keeps the cluster/replica
    distinction where it is load-bearing: the option is configured on the cluster,
    while the arrangements themselves live in the cluster's replicas, in each
    replica's memory.
  • Materialized views are named without being called arranged. Moritz
    Hoffmann's point was that an MV's result is persisted and does not necessarily
    form an arrangement; Kay Kim then asked for MVs to be mentioned anyway, since
    readers will wonder. The page says indexes and the arrangements that a
    dataflow builds internally for joins and aggregations, then adds: "A
    materialized view's stored result is not an arrangement, but the dataflow that
    maintains it builds these internal arrangements for any joins and aggregations
    it computes." Moritz Hoffmann confirmed that wording.
  • Replica replacement is described as a cutover, not a mutation. Moritz
    Hoffmann flagged that changing the option must not alter a running replica, and
    he is right that nothing does. replica-replacement.md now says a replica's
    compression setting is fixed when the replica is created, so changing the
    option never changes an existing replica's arrangements; Materialize instead
    creates a new set of replicas carrying the new setting, the existing replicas
    keep serving until the new ones have hydrated, and are then retired. It adds
    that the cluster temporarily uses roughly twice its usual memory until the
    switch completes in either direction, that nothing else is needed to apply the
    setting, that you should plan for it the way you would plan a resize, and that
    the switch takes longer when turning compression on than off. That is the
    behaviour after adapter: don't leak arrangement compression into the realized config #38112, which keeps compression a replica-shape dimension and
    fixes the reshape leak that previously defeated the graceful overlap. Kay Kim
    also asked for the warning to appear before the statements a reader would run,
    so it sits inside "Enable dictionary compression", above the syntax examples.
  • No performance numbers anywhere. The only figure that exists is a prototype
    benchmark note and is not publishable.

What review settled, so it does not have to be reconstructed from the
threads: the page is labelled public preview via the public-preview
shortcode; Enable dictionary compression sits above The tradeoff; the two
tradeoff subsections are When it helps and When it does not help; the
materialized-views sentence was confirmed by Moritz Hoffmann; the introducing
version is v26.38; availability.md was folded into overview.md; and the
replica behaviour the warning describes depends on #38112, which is still open.

SQL syntax was verified against the parser and tests, not written from
memory.

Form Confirmed at
CREATE CLUSTER ... (EXPERIMENTAL ARRANGEMENT COMPRESSION = true) src/sql-parser/src/parser.rs:4618, test/sqllogictest/managed_cluster.slt:420
ALTER CLUSTER ... SET (EXPERIMENTAL ARRANGEMENT COMPRESSION = true) test/sqllogictest/managed_cluster.slt:436, test/testdrive/cluster-controller.td:441
ALTER CLUSTER ... RESET (EXPERIMENTAL ARRANGEMENT COMPRESSION) test/sqllogictest/managed_cluster.slt:428
Rejected on unmanaged clusters test/sqllogictest/managed_cluster.slt:446-447
Default renders as = false in SHOW CREATE CLUSTER test/sqllogictest/cluster.slt:875

Please fact-check these specific claims:

  1. The "roughly 64 distinct values" taper point, and whether the surrounding
    observational wording reads the way engineering wants it to. This is the claim
    I am least able to ground in code myself.
  2. "on the order of 65,000 rows" for the from-scratch threshold. Is exposing
    this number useful to a customer, or should it just say "small arrangements
    are unaffected"?
  3. "A replica picks up the configured value when it is created and holds it for
    its lifetime."
    Is the lifetime wording right, and is it worth saying to a
    user at all?
  4. The cluster-level consequence of an ALTER, after adapter: don't leak arrangement compression into the realized config #38112. Confirmation
    that ALTER CLUSTER ... SET (EXPERIMENTAL ARRANGEMENT COMPRESSION = true) on
    a cluster that already has replicas gets that cluster's arrangements
    compressed on its own, through the reconfiguration record and the hydration
    overlap, with no second action from the user, and that RESET is the same
    path in the other direction.
  5. Whether the new replicas hydrate from persist or from the surviving
    replicas.
    I found no code suggesting replica-to-replica arrangement
    transfer, and no site that settles it either, so the pages say only that the
    new replicas hydrate.
  6. Whether the overlapping replica sets are billed twice. Both sets are
    ordinary non-pending replicas and both count against replica limits, but I did
    not trace billing at all. The warning scopes its claim to memory for exactly
    this reason.
  7. The list of what is arranged, now indexes plus the arrangements a dataflow
    builds internally for joins and GROUP BY/DISTINCT. I deliberately omitted
    the upsert-v2 persist-feedback arrangement as too internal. Should
    storage/upsert be mentioned at all?
  8. Read-path cost wording ("extra indirection", "cannot use the fast path").
    Is this too much detail, or not enough for someone sizing a cluster?

Deliberately not on the pages, since they could not be grounded: crash-restart
versus reprovision semantics for the value a replica captures, whether
enable_column_paged_batcher is also required for the feature to be fully
effective, and any compression ratio or hydration slowdown figure.

Verification

  • hugo --quiet from doc/user passes with no warnings or errors, using
    Hugo extended v0.152.2, both before and after the reference-page changes.
  • Verified the generated HTML for all three pages:
    • The new option renders in the CREATE CLUSTER syntax block, the
      ALTER CLUSTER ... SET syntax block, and the ALTER CLUSTER ... RESET
      syntax block.
    • The option table rows render on both reference pages, including the
      warning shortcode nested inside the ALTER CLUSTER row.
    • The three shared fragments resolve on every page that includes them, and the
      public-preview, warning, and warn-if-unreleased shortcodes all render.
    • The in-page #dictionary-compression anchors that the option tables link to
      exist on both reference pages.
    • No unresolved shortcode placeholders and no ZgotmplZ escapes in the
      output.
  • All internal links point at pages that exist in doc/user/content
    (/get-started/arrangements/, /concepts/indexes/, /sql/create-cluster/,
    /sql/alter-cluster/, /sql/show-create-cluster/, /support/,
    /transform-data/optimization/,
    /transform-data/dataflow-troubleshooting/).
  • mz_introspection.mz_arrangement_sizes and
    mz_introspection.mz_dataflow_arrangement_sizes were confirmed to be
    documented relations with the columns the example query selects
    (doc/user/content/reference/system-catalog/mz_introspection.md:60, :196).
  • Docs-only change. No Rust was built, and no automated test covers page prose.

Compression is applied per column, so a wide row can have one column compressed
and the rest untouched.

Dictionary compression is **alpha** and is **off by default at every layer**. It

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll enable it by default, so only the cluster/replica config is needed.

@claude claude Bot Aug 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. The page now presents EXPERIMENTAL ARRANGEMENT COMPRESSION on a cluster as the only way to turn compression on, and no longer frames the environment-wide flag as a requirement. It doesn't name that parameter anywhere, and the preview callout no longer asks users to contact us for enablement.


Generated by Claude Code

- **Large** arrangements. The larger the arrangement, the more occurrences of
each repeated value there are to collapse.

Only data held in an arrangement is affected. That means [indexes], materialized

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Materialized views don't necessarily form arrangements, so either leave out or say that internal arrangements use the feature.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left materialized views out. The sentence now reads "indexes and the arrangements a dataflow builds internally for joins and aggregations (GROUP BY, DISTINCT)", and I removed the other place that implied an MV's stored output is arranged.


Generated by Claude Code

```

The same option is available on [`CREATE CLUSTER REPLICA`]. It is not supported
on unmanaged clusters. [`SHOW CREATE CLUSTER`] reports the configured value.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unmanaged clusters = create cluster replica. Do you mean unmanaged replicas? They're a test-only thing.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, that was my confusion. I dropped the CREATE CLUSTER REPLICA form and the unmanaged-cluster sentence entirely, and swept the page so it documents a cluster option only (CREATE CLUSTER, ALTER CLUSTER ... SET, ALTER CLUSTER ... RESET) with no per-replica knob framing.


Generated by Claude Code

enabled. The flag decides whether a replica actually honors the value. A replica
captures the setting once, when it is created, and holds it for its lifetime, so
turning the flag on or off changes behavior only for replicas created
afterwards. For the same reason, a single cluster can hold a mix of compressed

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clusters don't hold arrangements, replicas do.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. The page now says the option is configured on the cluster while the arrangements it applies to live in the cluster's replicas, in each replica's memory, and the re-hydration warning talks about the new replicas rebuilding their arrangements.


Generated by Claude Code

maheshwarip added a commit that referenced this pull request Aug 10, 2026
### Motivation

Addresses the four open review comments from @maheshwarip on
#38024. This PR
targets that
PR's branch so the fixes land in it rather than as a competing page.

### Description

Four review comments, one file
(`doc/user/content/transform-data/dictionary-compression.md`):

- **"Rephrase as: When it helps"** — `### What it helps` is now `###
When it helps`.
- **"Rephrase as: When it does not help"** — `### What it does not help`
is now
  `### When it does not help`.
- **"Link to the arrangements page"** — the first mention of
arrangements in the
opening paragraph was a reference-style link, which is invisible in a
raw diff.
It is now an explicit inline link to
`/get-started/arrangements/#arrangements`,
  and the now-unused reference definition is dropped.
- **"Move this section above the section for 'The Tradeoff'"** —
`## Enable dictionary compression`, with its `### Set the option on a
cluster`
subsection, the re-hydration warning, and the cluster-versus-replica
paragraph,
now sits directly after the intro and ahead of `## The tradeoff`. The
page reads
intro → how to turn it on → when it helps and what it costs → how
distinct values
  affect the benefit → how to observe the effect.

Two wording follow-ons the move forced, both minimal:

- The intro's forward pointer to `#enable-dictionary-compression` is
gone, since
that section is now the very next thing on the page, as is the
enablement
section's opening line that restated "controlled by the cluster option
...
defaults to off" (the sentence immediately above it already says that).
- "The tradeoff" opened with "Read this section before you turn it on",
which
no longer holds once enablement precedes it. It now reads "Use this
section to
  judge whether it suits your workload."

No other prose changed, and no claim on the page was altered. The open
fact-check questions in the original PR description are untouched.

### Verification

- Read through the reordered page for broken cross-references. The
in-page anchor
`#how-distinct-values-affect-the-benefit` still resolves,
`#arrangements` is a real
heading on `/get-started/arrangements/`, and every remaining
reference-style link
definition is still used (`[Arrangements]`, `[indexes]`, `` [`SHOW
CREATE CLUSTER`] ``,
  and the two `mz_introspection` ones).
- Confirmed nothing outside this file links to the page or to the two
renamed
  anchors, so the heading renames break no inbound links.
- **`hugo` was not re-run**: it is not installed in this environment.
The change is
prose and section ordering only, with no new or edited shortcodes, so
the build
surface is unchanged from the clean `hugo --quiet` run reported on
#38024.

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

https://claude.ai/code/session_016x1x9sYXTsYAdbN8Hftqe5

---
_Generated by [Claude
Code](https://claude.ai/code/session_016x1x9sYXTsYAdbN8Hftqe5)_

Co-authored-by: Claude <[email protected]>
ALTER CLUSTER my_cluster SET (EXPERIMENTAL ARRANGEMENT COMPRESSION = true);
```

To go back to the default:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DAlperin @antiguru if you turn dict compression back off, is there anything to be aware of? This would increase memory usage right? Any other gotchas to be aware of?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is my reading of the code, not an answer from Dov or Moritz, so please correct anything I have wrong. @DAlperin @antiguru.

Memory does go back up, but only to the uncompressed baseline. The new replicas are created with the option off, so their arrangements are uncompressed. Memory rises relative to the compressed cluster by whatever compression was saving, and on a workload where compression bought nothing it does not rise at all.

The bigger effect is a transient overlap during the change, and it happens in both directions. The option is part of the replica shape, so changing it provisions a new replica set rather than reconfiguring the existing replicas. The controller runs the old and the new set side by side and only cuts over once the new replicas are hydrated, so the cluster holds roughly twice its usual memory until then (src/cluster-controller/src/strategy.rs:208-213, and the adapter says it in as many words at src/adapter/src/coord/sequencer/inner/cluster.rs:554-560). A plain ALTER CLUSTER ... RESET (EXPERIMENTAL ARRANGEMENT COMPRESSION) goes through that same path, with no WAIT clause needed.

That peak is checked before the statement is accepted. An ALTER whose old plus new replica count does not fit is rejected at statement time rather than failing partway through (cluster.rs:565-574).

The statement returns before any of it has happened. It returns once the reconfiguration record is written (src/adapter-types/src/dyncfgs.rs:388-392), not once the cluster has re-hydrated. If the new replicas do not hydrate before the default timeout, the change rolls back and the cluster stays as it was (strategy.rs:352-369). Turning compression off is the favourable direction here, since hydration is faster without it.

SET = false and RESET are the same thing. Both land on false (cluster.rs:248-252), and SHOW CREATE CLUSTER renders an explicit = false either way (test/sqllogictest/managed_cluster.slt:428-433). Turning the option off on a cluster that already has it off is a no-op and reprovisions nothing.

The transition itself looks safe. Nothing reads compressed data with compression off, and the new replicas are fresh processes that hold the value for their lifetime, so a replica is either wholly compression-capable or wholly not, never a mix left over from the change.

One asymmetry is worth knowing, and it is the closest thing to a gotcha I found. The replica shape carries the cluster option's configured value, before the environment-wide gate is applied. So turning the cluster option off reprovisions the cluster even on a cluster where nothing was ever actually compressed, which is a re-hydration cost for no memory change. Turning the environment-wide gate off is the opposite: it changes no shape and reprovisions nothing, and existing replicas keep compressing until they are restarted or recreated.

I have pushed a wording change to this branch (6c24e09) so the page already reflects the overlap. The warning now says the change applies whether you turn the option on or off, and that the cluster temporarily uses roughly twice its usual memory until the switch completes. I scoped that sentence to memory on purpose, because the billing question below is unresolved.

Two things I could not establish from the code, and they are the reason this is a starting point rather than an answer. First, whether the new replicas re-hydrate from persist or from the surviving replicas. I found no code suggesting replica-to-replica arrangement transfer, but I also did not find a site that settles it, so I am not asserting either. Second, whether the doubled replica set during the overlap is billed twice. Both sets are ordinary non-pending replicas and both count against replica limits, but I did not trace billing at all.


Generated by Claude Code

@maheshwarip
maheshwarip marked this pull request as ready for review August 12, 2026 00:50
@maheshwarip
maheshwarip requested a review from a team as a code owner August 12, 2026 00:50
@maheshwarip maheshwarip changed the title docs: add dictionary compression page docs: document dictionary compression Aug 12, 2026
---
{{< warn-if-unreleased "v26.37" >}}

Dictionary compression is available starting in **v26.37**. It is in **public

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Qs:

  • So, is this enable_arrangement_dictionary_compression_alpha the flag for turning on this feature?

  • Then for Cloud, it will be set via LD?

  • But, for self-managed, what happens, because in the repo, the flag is still false. Or is this meant only for Cloud?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc: @maheshwarip ... just because of the flag thing.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth clearing one thing first: the page never named enable_arrangement_dictionary_compression_alpha. Not in this partial, not anywhere in doc/. I checked the file's full history as well as the current tree. The user-facing text documents only the cluster option, deliberately, per Moritz's earlier note on this PR that the environment-wide parameter will default on.

As a reading of the code today, not a product answer: enablement is two layers ANDed at src/compute-client/src/controller.rs:728-731, the environment-wide dyncfg and the per-cluster EXPERIMENTAL ARRANGEMENT COMPRESSION option. The dyncfg is default: false in the repo right now (src/compute-types/src/dyncfgs.rs:454-458), environment-scoped and not user visible. Both layers have to be on before anything compresses.

What that means for Cloud versus self-managed, and whether the in-repo default changes before release, I cannot settle from the code. @maheshwarip, that one is yours.


Generated by Claude Code

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm it should be enabled by default for everyone

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anchor note: this thread is on availability.md, which no longer exists — bd734d2 (editorial review round) folded it into headless/dictionary-compression/overview.md, included by the guide, CREATE CLUSTER and ALTER CLUSTER. The sentence you're reacting to now lives at overview.md:12-13:

Dictionary compression is off by default. You opt in per cluster with the EXPERIMENTAL ARRANGEMENT COMPRESSION option.

Both switches default to false in the repo today, ANDed at replica creation (src/compute-client/src/controller.rs:729-731):

  • environment-wide dyncfg enable_arrangement_dictionary_compression_alpha — src/compute-types/src/dyncfgs.rs:454-458
  • cluster option EXPERIMENTAL ARRANGEMENT COMPRESSION — src/sql/src/plan/statement/ddl.rs:4996 (unwrap_or(false))

Q1 — which "it"?

(a) The environment-wide gate defaults on for everyone, Cloud and self-managed alike, while the cluster option stays off and users opt in per cluster. No page change needed — the page documents only the cluster option and never names the internal parameter. This is the reading I expect, since it matches @antiguru earlier on this PR ("We'll enable it by default, so only the cluster/replica config is needed").

(b) Dictionary compression itself is on for every cluster, no opt-in. This contradicts the page's central framing and means rewriting the overview, the guide's enablement section, and the CREATE CLUSTER / ALTER CLUSTER option entries. Note the cluster option currently defaults to false in code, so (b) would also need a code change.

Q2 — which version should the page name?

The page says "Starting in v26.37" and points warn-if-unreleased at v26.37, but v26.37 is already released: true on main (doc/user/content/releases/v26.37.md:4), so the banner renders nothing (layouts/shortcodes/warn-if-unreleased.html:7). The replica behaviour the page describes needs #38112, still open and pinned at 26.38.0-dev.0 (src/adapter/src/catalog/open/builtin_schema_migration.rs:363), so v26.38 at the earliest. Should the page say v26.38?


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Answered: v26.38. Done in c064c22.

The page now says "Starting in v26.38", and all four shortcode call sites point at v26.38: the warn-if-unreleased in headless/dictionary-compression/overview.md plus three warn-if-unreleased-inline calls across data/examples/create_cluster.yml and data/examples/alter_cluster.yml.

The banner renders. releases/v26.38.md exists on main as released: false with date: 2026-08-19, so all four emit. I checked the built HTML rather than assuming, and got "The release is scheduled to complete by August 19, 2026" on the overview page and on both cluster reference pages.

One caveat about the deploy preview on this PR. This branch is behind main and does not carry releases/v26.38.md yet, so in a branch-only build the shortcode finds no release page. The banner still appears, but the date renders as "January 1, 0001". With main's copy of that file in place the date is correct. This resolves once the branch picks up main, and I did not commit a copy of the release file, because release automation owns it and it already exists there.

For the record on why v26.37 had gone quiet: main flipped releases/v26.37.md to released: true, and both shortcodes only emit under {{if not $isReleased}}. The branch still carries released: false for v26.37, which is why the preview showed a banner that would have vanished on merge.

hugo exits 0.


Generated by Claude Code

---
Dictionary compression reduces the memory that
[arrangements](/get-started/arrangements/#arrangements) use when a column holds
the same values over and over. Instead of storing a repeated value in full once

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe instead of "over and over" -> "repeatedly" (since we'll mention repeated value in the next sentence).

Maybe just get rid of "in full" and let's scope the "once per row" maybe? so like
"Instead of storing the repeated column value each time it appears" or "Instead of storing the repeated column value in each row it appears"?

Comment on lines +5 to +11
Changing `EXPERIMENTAL ARRANGEMENT COMPRESSION` on a cluster, whether you turn
it on or off, replaces the cluster's replicas, so the cluster re-hydrates. The
new replicas have to rebuild their arrangements, and the existing replicas keep
serving until the new ones are ready, so the cluster temporarily uses roughly
twice its usual memory until the switch completes. Plan for this the same way
you would plan for resizing a cluster. Hydration is slower with compression
enabled, so turning the option on takes longer than turning it off.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe?

Suggested change
Changing `EXPERIMENTAL ARRANGEMENT COMPRESSION` on a cluster, whether you turn
it on or off, replaces the cluster's replicas, so the cluster re-hydrates. The
new replicas have to rebuild their arrangements, and the existing replicas keep
serving until the new ones are ready, so the cluster temporarily uses roughly
twice its usual memory until the switch completes. Plan for this the same way
you would plan for resizing a cluster. Hydration is slower with compression
enabled, so turning the option on takes longer than turning it off.
Changing `EXPERIMENTAL ARRANGEMENT COMPRESSION` on a cluster replaces the
cluster's replicas. While the replacement replicas hydrate, the existing
replicas keep serving until the new ones are ready. As a result, the cluster
temporarily uses roughly twice its usual memory until the switch completes,
regardless of whether you enable or disable dictionary compression.
Plan for this the same way you would plan for resizing a cluster. Because
hydration is slower with compression enabled, the replacement takes longer when
turning compression on than when turning it off.

on every workload. The savings come from large arrangements with columns that
hold a small set of longer values repeated across many rows, such as status
strings, enum-like labels, or tenant IDs. High-cardinality columns pay the CPU
cost without any memory benefit, and that cost is most visible as slower

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: is it w/o any memory benefit? (i.e., absolute)? or more "with little or no memory benefit" ?

## Enable dictionary compression

Set the `EXPERIMENTAL ARRANGEMENT COMPRESSION` option on each cluster whose
arrangements you want compressed. No other setting is involved.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

? Why do we want to state "No other setting is involved." ?

### When it does not help

- **High-cardinality or near-unique columns.** A value that never repeats is
never worth storing in a dictionary, so such a column sees no memory savings.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to never twice here? Maybe to tie into the lead's "high-cardinality/near-unique columns"
Unique values are not worth storing in a dictionary, so columns dominated by them see little or no memory savings.

never worth storing in a dictionary, so such a column sees no memory savings.
Materialize has no heuristic that detects this and skips the column. It
inspects every column of every row regardless, so a near-unique column pays
the full CPU cost for zero memory benefit. Large arrangements dominated by

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so near-unique column (vs non-unique) could have some minor benefit, yes? So, maybe for little or no memory benefit?

inspects every column of every row regardless, so a near-unique column pays
the full CPU cost for zero memory benefit. Large arrangements dominated by
unique identifiers, timestamps, or free-form text carry the cost without the
benefit.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto


- **High-cardinality or near-unique columns.** A value that never repeats is
never worth storing in a dictionary, so such a column sees no memory savings.
Materialize has no heuristic that detects this and skips the column. It

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By "this" , did you mean "Materialize has no heuristic for detecting and skipping high-cardinality columns." ?

### The CPU cost

The cost falls mainly on the write path. As updates arrive, Materialize has to
track which values in each column repeat and maintain the dictionary. The most

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q for my edification: By tracking, are we keeping counts? or is this looking in the dictionary

@claude

claude Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

Editorial review pass

Thanks @kay-kim, this was a useful pass. Commit bd734d2 applies the wording and structure changes. Below is what changed, what I answered, and what is still open, grouped by file. I have replied inline only on the three threads that need a specific person, rather than on every comment.

headless/dictionary-compression/overview.md

"over and over" is now "repeatedly", and "in full" is gone, with the comparison scoped to each appearance: "Instead of storing a repeated column value each time it appears".

I also took your warn-if-unreleased restructure, close to the shape you sketched. The overview now opens with the banner and "Starting in v26.37, dictionary compression is available for managed clusters", and closes with the off-by-default and opt-in sentence.

headless/dictionary-compression/availability.md (removed)

Your two comments here pointed the same way and I agree with both, so the partial is gone and its content folded into the overview.

  • The "public preview" sentence was duplicated. All three including pages already render the public-preview shortcode immediately above it. That also answers your alter-cluster.md comment, which was the same observation.
  • Once that sentence goes, the partial was a banner plus two sentences, included on exactly the same three pages as the overview and always directly next to it. It was not earning its separation. Reuse is unaffected, since the overview is included everywhere the availability partial was.

One knock-on edit: on the guide, the following paragraph began "The values that repeat most often within a column are stored this way", and "this way" lost its adjacent referent. It now reads "Within a column, the values that repeat most often are the ones Materialize stores once and references."

headless/dictionary-compression/replica-replacement.md

Applied your suggestion block essentially verbatim.

headless/dictionary-compression/tradeoff-summary.md

"without any memory benefit" is now "with little or no memory benefit". See the note on absolutes below.

transform-data/dictionary-compression.md

  • "each managed cluster", as suggested.
  • The replica replacement warning moved above the SQL examples, so the memory cost is visible before anyone runs anything. The cluster-versus-replica paragraph moved up with it, since the warning talks about replicas.
  • "Essentially all of the savings" is now "Most or all of the memory savings". The helps bullet leads with "a small set of often-repeated, longer values" and the examples follow as "Typical examples are ...".
  • The large-arrangements bullet took your sentence, with the semicolon turned into a comma for the repo prose rules.
  • "that" added before "a dataflow builds".
  • Your reading of "this" was right. It now says "Materialize has no heuristic for detecting and skipping high-cardinality columns."

On the absolute claims. You flagged three of these and you are right on the facts. In the code only values seen more than once are dictionary candidates, so a near-unique column that still contains some repetition does get a small benefit. A flat zero overstated it. All three are now "little or no", and I checked that the tradeoff summary's lead agrees with the page's bullets rather than contradicting them. I dropped what would have been a fourth use of the phrase in the same bullet and ended it with "Unique identifiers, timestamps, and free-form text are typical examples" instead.

"No other setting is involved." Cut. Your instinct was right, and the sentence was worse than odd, it was inaccurate. Enablement is not single-layer in the code, so a sentence claiming nothing else is involved overclaimed. It existed to stop readers hunting for a flag the docs deliberately do not name, but removing it costs nothing, because the page never pointed at another setting in the first place.

Your line 100 question, whether "tracking" means counts or a dictionary lookup. Counts, and approximate ones. On the write path Materialize maintains a running heavy-hitters summary per column, so it is tracking which values repeat most rather than looking anything up. The page now says it "keeps approximate counts of which values repeat most in each column".

Still open

Three items need someone else, and I have replied inline on each rather than guessing.

  1. The flag question, and what it means for Cloud versus self-managed. Now @maheshwarip's, per your cc. Worth noting up front that the docs never named enable_arrangement_dictionary_compression_alpha, so there is nothing to unwind in the page itself.
  2. Whether v26.37 is the right version. The banner renders correctly, but the number depends on the same product answer as item 1.
  3. The materialized views sentence. Applied, but @antiguru should confirm the wording, since he raised the original constraint.

Build

hugo --quiet from doc/user exits 0. The partials render on all three including pages with exactly one unreleased banner and one preview callout each, no shortcode placeholders leak, and the in-page anchors still resolve, including #how-distinct-values-affect-the-benefit after the section moves.


Generated by Claude Code

headless: true
---
{{< warning >}}
Changing `EXPERIMENTAL ARRANGEMENT COMPRESSION` on a cluster replaces the

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, it shouldn't cause existing replicas to change, only new ones should get the setting. It'd be a bug if it did.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read the code instead of defending the sentence. Both statements are true, about different switches, and I think that is where this splits.

You are right that nothing mutates a running replica. The value is stored once at instance creation and apply_worker_config deliberately does not re-apply it (src/compute/src/compute_state.rs:560-570, and the NB at :312-315). The environment-wide gate is also read at replica creation and is not part of the shape (src/compute-client/src/controller.rs:721-731), so flipping that leaves existing replicas alone, exactly as you describe.

But the cluster option is a replica shape dimension, so an ALTER replaces the replica set. arrangement_compression is a field of ReplicaShape (src/adapter-types/src/cluster_state.rs:66) and is compared in ReplicaShape::matches (:74-79). alter_changes_replica_shape checks it (src/adapter/src/coord/sequencer/inner/cluster.rs:2617-2635). With the controller gate on, which is the default (src/adapter-types/src/dyncfgs.rs:363-367), a shape-changing ALTER routes to reshape_alter_cluster_managed (cluster.rs:379-421), which writes a reconfiguration record carrying arrangement_compression as a target dimension (cluster.rs:690-707). GracefulReconfigurationStrategy then desires target-shape replicas in addition to the realized-shape ones, "so both sets serve while the new one hydrates", dropping the old set after cut-over (src/cluster-controller/src/strategy.rs:205-216). On the legacy path the same field drives config_changed, which recreates the whole set (cluster.rs:2004-2010, src/catalog/src/memory/objects.rs:3367-3406). test/testdrive/cluster-controller.td:441 uses ALTER CLUSTER ... SET (EXPERIMENTAL ARRANGEMENT COMPRESSION = true) specifically as a shape-changing ALTER that folds onto an in-flight record.

One detail that may matter to your read: the doc comment on alter_changes_replica_shape enumerates the shape dimensions as SIZE, AVAILABILITY ZONES and the INTROSPECTION options (cluster.rs:2608-2610) and does not mention compression, while the body checks it.

So which is it?

  1. I have misread the above.
  2. The reprovisioning is real and unintended, so this is a bug.
  3. It is intended, and the page needs to say "replaces" in a way that cannot be read as mutating an existing replica.

If it is 2, the page is documenting a bug and the fix belongs in ReplicaShape and alter_changes_replica_shape, not in the prose. I have left the warning untouched pending your answer, including its claim that the cluster holds roughly twice its usual memory during the overlap. That follows from the strategy above, and it should not ship if the overlap should not happen at all.


Generated by Claude Code

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aljoscha Can you confirm the desired behavior when altering a cluster? My knowledge here seems outdated.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be fixed by #38112

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the pointer. Reading #38112 changed my understanding, though not in the direction I expected, so I want to check it with you before this ships.

#38112 does not take compression out of the replica shape. It keeps it a shape dimension and fixes three places whose hand-maintained dimension lists had forgotten it. The one that matters here is the reshape leak: reshape_alter_cluster_managed reset the shape back to the realized values by listing size, replication factor, AZs and logging, and missed compression, so a compression-carrying ALTER flipped the realized config immediately and the baseline strategy then bounced the baseline replicas mid-reconfiguration. The fix routes that reset through realized_reconfiguration_target / apply_reconfiguration_target, so the transition is deferred to the record's cut-over and the graceful overlap actually happens.

So my old wording was wrong as a description of intent, but not in the way I assumed when you flagged it. It said "replaces the cluster's replicas", which reads as mutating a running replica, and that never happens. What it described as the overlap is the post-fix behaviour, and pre-fix that overlap was defeated rather than absent.

The page now says: a replica's setting is fixed when the replica is created, so changing the option never changes an existing replica's arrangements. Materialize creates a new set of replicas carrying the new setting, the existing ones keep serving until the new ones have hydrated, then they are retired. The roughly-doubled memory during the overlap stays, and it now also says no further action is needed to apply the setting.

Could you confirm the user-visible consequence I read off the diff: after #38112, an ALTER ... SET (EXPERIMENTAL ARRANGEMENT COMPRESSION = true) on a cluster that already has replicas does get that cluster's arrangements compressed on its own, via the record and the hydrate-overlap, with no second action from the user. Your original note reads as "only new replicas get the setting", which is true of the individual replicas but not of the cluster, and I want to be sure the docs land on the right side of that. The cc_compression section #38112 adds to cluster-controller.td is what I based this on, since it asserts the surviving replica afterwards is a new one rather than the baseline.

One timing question that is not mine to settle, flagging it for @maheshwarip too: #38112 is still open and stacked on aljoscha/cluster-legacy-04-zdt-flag, and its migration step is pinned at 26.38.0-dev.0, while main has already marked v26.37 released. This partial would then be describing v26.38 behaviour on a page that says "Starting in v26.37", and the warn-if-unreleased banner renders nothing once v26.37 is released, so it does not cover the gap.


Generated by Claude Code

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question this doesn't answer is: What if a workload has some columns that compress well, mixed with columns that don't compress well? In this case, only the compressible columns will benefit, but all will pay the CPU tax. The flag cannot be specified per-arrangement column (and it wouldn't be possible, because the optimizer decides on which intermediate arrangements to form.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in 5c34fc4, at the end of "When it does not help", where the per-column discussion already lives:

Real workloads usually mix the two. An arrangement often holds a few columns that compress well alongside others that do not, and only the compressible ones save memory while every column still pays the CPU cost. You cannot target individual columns, because the option is set per cluster and the optimizer decides which intermediate arrangements a dataflow builds.

I kept your reason for why per-column would not work, since which intermediate arrangements exist is a planning question rather than an internals one.


Generated by Claude Code

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So ... we now have on line 20-21:

Compression is applied per column, so a wide row can
have one column compressed and the rest untouched.

but the patch added "You cannot target individual columns" ... I think people might get confused.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, and it was a wording collision rather than a wrong fact. The mechanism works per column, the control is the cluster. Reworded both so neither sentence can be read as denying the other.

Lines 18-21 now:

Within a column, the values that repeat most often are the ones Materialize stores once and references. Everything else is stored as-is, exactly as it would be without compression. Materialize applies compression per column and decides which columns to compress, so a wide row can have one column compressed and the rest untouched.

The note under "The tradeoff" now:

A single arrangement usually holds both columns that compress well and columns that do not. Only the columns that compress save memory, and every column still pays the CPU cost. Materialize decides which columns get compressed, and you cannot select them yourself. You turn compression on per cluster, and the optimizer chooses which intermediate arrangements a dataflow builds.

"You cannot target individual columns" is gone, because on its own it read as denying the per-column behaviour instead of describing what you control. Both facts are still there. The per-column one explains why a mixed workload behaves the way it does, and the per-cluster one is the thing someone would otherwise go hunting for.

One third spot, in "When it does not help", which is also the sentence you asked about earlier. "Materialize has no heuristic for detecting and skipping high-cardinality columns" could be read as saying Materialize makes no per-column decision at all, so it now reads "Materialize does not detect a high-cardinality column and skip it up front." The next sentence about inspecting every column of every row is unchanged, so the CPU point still lands.

8d89fe7. hugo exits 0.


Generated by Claude Code

dictionary until it has seen on the order of 65,000 rows. Small arrangements
are effectively unaffected.

Real workloads usually mix the two. An arrangement often holds a few columns that

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So ... this paragraph is misplaced. mix the two what? To pull it out a little:

  • make it a note
  • and clarify.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both done in 8d5a322.

It is now a {{< note >}} sitting under "The tradeoff", directly after the intro and above "When it helps". That was the fix for the misplacement: it applies to both subsections, so as a trailing paragraph of "When it does not help" it read as a fourth item of that list. Above both headings it belongs to neither and covers each, and it previews the two lists that follow.

On "the two", I dropped it and named both kinds of column in the opening instead, so the note stands on its own:

A single arrangement usually holds both columns that compress well and columns that do not. Only the columns that compress save memory, and every column still pays the CPU cost. You cannot target individual columns, because the option is set per cluster and the optimizer decides which intermediate arrangements a dataflow builds.

Same substance as before, three sentences instead of three plus a dangling referent. hugo exits 0 and the note renders. No headings moved, so every anchor on the page is unchanged.


Generated by Claude Code

claude and others added 12 commits August 14, 2026 11:00
Add a user-facing page describing arrangement dictionary compression: what
it does, which workloads it helps and which it does not, the CPU cost, how
it is enabled across the environment-wide flag and the per-cluster option,
and how to observe the effect via existing arrangement-size introspection.

Placed under Transform data next to Query optimization. Draft for review by
engineering and product.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_011qG1yBKqdKBxetwNFnihwi
Per engineering feedback, drop any statement of a supported per-column
capacity. Instead give a non-committal rule of thumb: compression helps most
below about 64 distinct values per column, with diminishing returns above
that, trending toward pure CPU overhead as distinct values grow.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_011qG1yBKqdKBxetwNFnihwi
Address review feedback on the dictionary compression page:

- The environment-wide dyncfg will default on, so the page no longer
  presents enablement as two layers and no longer names the internal
  parameter. `EXPERIMENTAL ARRANGEMENT COMPRESSION` on a cluster is now
  the only documented knob, and it still defaults to off.
- Drop materialized views from the list of arranged data. A materialized
  view's result is persisted, not necessarily arranged. The feature
  applies to indexes and the arrangements a dataflow builds internally.
- Remove the `CREATE CLUSTER REPLICA` variant and all per-replica knob
  framing. That syntax only applies to unmanaged clusters, which are
  test-only.
- Say that arrangements live in a cluster's replicas rather than in the
  cluster, while the option is configured on the cluster.

The preview callout stays, now with enabled-by-default so it reads as
"this is experimental" rather than asking users to have a flag turned on.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_011qG1yBKqdKBxetwNFnihwi
Retitle the distinct-values section and restate it as behavior rather
than instruction. The section now describes where the memory benefit is
largest, how it tapers off past roughly 64 distinct values, and how it
becomes overhead with no saving, leaving the reader to draw the
conclusion. Soften the same tone in the cross-reference from "What it
helps" and in the high-cardinality caveat.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_011qG1yBKqdKBxetwNFnihwi
Style pass over the page, no change to technical substance. Apply the
prose guidance from the requesting engineer's writing preferences:

- Cut over-bolding. Bold now marks only the alpha status, the "does not
  reduce memory on every workload" warning, and the labels in the "What
  it does not help" list. Mid-sentence emphasis on "off by default",
  "write path", "slower arrangement hydration", the repeated-values
  clause, and the replica-replacement warning is gone. The warning
  callout already carries its own visual weight.
- Drop the self-referential "this is the most important caveat on this
  page". The caveat leads the list, so its priority is already clear.
- Replace the rote three-item denial "not a limit, threshold, or
  capacity" with a plain "This is not a limit", keeping the point that
  nothing breaks past that many distinct values.
- Remove the "for better or worse" aside and a "therefore" that only
  restated the bullet it closed.

Every fact on the page stays, including the roughly 64 taper as
behavior, the cluster-only option, and arrangements living in replicas.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_011qG1yBKqdKBxetwNFnihwi
### Motivation

Addresses the four open review comments from @maheshwarip on
#38024. This PR
targets that
PR's branch so the fixes land in it rather than as a competing page.

### Description

Four review comments, one file
(`doc/user/content/transform-data/dictionary-compression.md`):

- **"Rephrase as: When it helps"** — `### What it helps` is now `###
When it helps`.
- **"Rephrase as: When it does not help"** — `### What it does not help`
is now
  `### When it does not help`.
- **"Link to the arrangements page"** — the first mention of
arrangements in the
opening paragraph was a reference-style link, which is invisible in a
raw diff.
It is now an explicit inline link to
`/get-started/arrangements/#arrangements`,
  and the now-unused reference definition is dropped.
- **"Move this section above the section for 'The Tradeoff'"** —
`## Enable dictionary compression`, with its `### Set the option on a
cluster`
subsection, the re-hydration warning, and the cluster-versus-replica
paragraph,
now sits directly after the intro and ahead of `## The tradeoff`. The
page reads
intro → how to turn it on → when it helps and what it costs → how
distinct values
  affect the benefit → how to observe the effect.

Two wording follow-ons the move forced, both minimal:

- The intro's forward pointer to `#enable-dictionary-compression` is
gone, since
that section is now the very next thing on the page, as is the
enablement
section's opening line that restated "controlled by the cluster option
...
defaults to off" (the sentence immediately above it already says that).
- "The tradeoff" opened with "Read this section before you turn it on",
which
no longer holds once enablement precedes it. It now reads "Use this
section to
  judge whether it suits your workload."

No other prose changed, and no claim on the page was altered. The open
fact-check questions in the original PR description are untouched.

### Verification

- Read through the reordered page for broken cross-references. The
in-page anchor
`#how-distinct-values-affect-the-benefit` still resolves,
`#arrangements` is a real
heading on `/get-started/arrangements/`, and every remaining
reference-style link
definition is still used (`[Arrangements]`, `[indexes]`, `` [`SHOW
CREATE CLUSTER`] ``,
  and the two `mz_introspection` ones).
- Confirmed nothing outside this file links to the page or to the two
renamed
  anchors, so the heading renames break no inbound links.
- **`hugo` was not re-run**: it is not installed in this environment.
The change is
prose and section ordering only, with no new or edited shortcodes, so
the build
surface is unchanged from the clean `hugo --quiet` run reported on
#38024.

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

https://claude.ai/code/session_016x1x9sYXTsYAdbN8Hftqe5

---
_Generated by [Claude
Code](https://claude.ai/code/session_016x1x9sYXTsYAdbN8Hftqe5)_

Co-authored-by: Claude <[email protected]>
The feature is in public preview, so use the public-preview shortcode and
drop the "alpha" wording from the prose.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016x1x9sYXTsYAdbN8Hftqe5
The re-hydration warning read as if the cluster's replicas were swapped.
The old replicas keep serving while the replacements hydrate, so the
cluster temporarily uses roughly twice its usual memory until the switch
completes. Also make the warning explicitly cover both directions, and
move the "hydration is slower with compression enabled" clause to the end
so the paragraph no longer reads as advice about turning the option on.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_011qG1yBKqdKBxetwNFnihwi
Adds the `EXPERIMENTAL ARRANGEMENT COMPRESSION` cluster option to the
`CREATE CLUSTER` and `ALTER CLUSTER` reference pages, and notes that
dictionary compression is available starting in v26.37.

The reference pages stay brief and link to the dictionary compression
guide for the full tradeoff. The prose that would otherwise be repeated
across the three pages now lives in
`content/headless/dictionary-compression/`:

- `overview.md`: what dictionary compression is (all three pages).
- `availability.md`: version, preview status, and the option name, with
  the `warn-if-unreleased` banner so it clears everywhere at once when
  v26.37 ships (all three pages).
- `tradeoff-summary.md`: the condensed tradeoff plus the pointer to the
  guide (both reference pages).
- `replica-replacement.md`: the re-hydration warning for changing the
  option (guide and `ALTER CLUSTER`).

Verified with `hugo` extended v0.152.2 from `doc/user`: the build is
clean, the syntax blocks and option tables render the new option on both
reference pages, the in-page `#dictionary-compression` anchors resolve,
and no shortcode placeholders leak into the output.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01DkC3rEiMSjF2E59xNLdveG
Applies the wording and structure changes from Kay Kim's review of the
dictionary compression page and its partials.

Wording:

- "over and over" becomes "repeatedly", and the overview no longer says
  "in full", scoping the comparison to each appearance of the value.
- "Essentially all of the savings" becomes "Most or all of the memory
  savings", and the "When it helps" bullets lead with the examples.
- Adds "that" before "a dataflow builds", and names managed clusters
  where the option is set.
- Spells out what "this" referred to: Materialize has no heuristic for
  detecting and skipping high-cardinality columns.
- Describes the write-path cost as keeping approximate counts of which
  values repeat most, which is what the code does.

Absolute claims about high-cardinality columns are softened to "little
or no memory benefit". A near-unique column can still hold some repeated
values, and only values seen more than once are dictionary candidates,
so a flat zero overstated it. The tradeoff summary's lead now agrees
with the bullets on the page.

Structure:

- The replica replacement warning moves above the SQL examples so the
  memory cost is visible before anything is run, and takes the
  cluster-versus-replica explanation with it.
- The availability partial folds into the overview partial. It was
  included on the same three pages, always alongside the overview, and
  its "public preview" sentence duplicated the public-preview shortcode
  that each of those pages already renders.
- Drops "No other setting is involved." Enablement is not single-layer,
  so the sentence claimed a completeness the product does not have.

The version claim and the preview label are unchanged.

Verified with hugo extended v0.152.2 from doc/user: the build is clean,
the partials render on all three including pages with exactly one
unreleased banner and one preview callout each, no shortcode
placeholders leak, and the in-page anchors still resolve.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_011qG1yBKqdKBxetwNFnihwi
A real workload rarely splits cleanly into the two bullet lists above it.
Record the workload-level consequence: only the compressible columns save
memory while every column pays the CPU cost, and the option is per cluster
with no way to target individual columns.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_011qG1yBKqdKBxetwNFnihwi
Moritz raised that changing EXPERIMENTAL ARRANGEMENT COMPRESSION should not
alter existing replicas, only new ones. The warning said "replaces the
cluster's replicas", which can be read as mutating a running replica.

A replica captures the setting once at instance creation and holds it fixed
(src/compute/src/compute_state.rs, the NB in apply_worker_config and the store
in handle_create_instance), so no existing replica ever changes. The option is
a ReplicaShape dimension (src/adapter-types/src/cluster_state.rs), so an ALTER
writes a reconfiguration record and the graceful strategy runs the new replica
set alongside the existing one until the new one hydrates
(src/cluster-controller/src/strategy.rs). The overlap, and the roughly doubled
memory it implies, is real and stays documented.

Also state that no further action is needed to apply the setting, so nobody
reads the replacement as something they have to trigger themselves.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_011qG1yBKqdKBxetwNFnihwi
claude added 4 commits August 14, 2026 11:00
The `EXPERIMENTAL ARRANGEMENT COMPRESSION` cells for both `SET` and
`RESET` said changing the option "replaces the cluster's replicas",
which reads as mutating a running replica. That never happens: the
setting is fixed when a replica is created, and Materialize provisions a
new set of replicas carrying the new setting and cuts over to them once
they have hydrated.

Reword both cells to match the wording already used in the
dictionary-compression partial, keeping the link to the section that
carries the full warning.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_011qG1yBKqdKBxetwNFnihwi
The paragraph about arrangements holding both compressible and
incompressible columns sat at the end of the "When it does not help"
list, where it read as a trailing item of that list even though it
applies to both cases. Its opening also leaned on "the two", which has
no referent at that position.

Move it into a note under "The tradeoff", above both subsections, so it
covers each of them, and reword the opening to stand on its own. The
substance is unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_011qG1yBKqdKBxetwNFnihwi
The page said compression is applied per column and also that you cannot
target individual columns, which read as a contradiction. Both facts hold,
they are just about different things. The mechanism works per column and
Materialize picks the columns. The control is the cluster option.

Say so in both places, and stop describing high-cardinality columns in a
way that suggests Materialize does not decide per column at all.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_011qG1yBKqdKBxetwNFnihwi
The page named v26.37 in prose and pointed its unreleased-warning
shortcodes at that version. v26.37 has since been marked released on
main, which silently switched the banner off, because both shortcodes
render only when the target release page says released is false.

Move the prose mention and all four shortcode call sites to v26.38, one
warn-if-unreleased on the overview page and three
warn-if-unreleased-inline calls across the create cluster and alter
cluster option tables.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_011qG1yBKqdKBxetwNFnihwi
@kay-kim
kay-kim force-pushed the docs/dictionary-compression branch from c064c22 to 23f3461 Compare August 14, 2026 15:02
@maheshwarip
maheshwarip merged commit b9ba15b into main Aug 14, 2026
11 checks passed
@maheshwarip
maheshwarip deleted the docs/dictionary-compression branch August 14, 2026 15:28
Comment on lines +4 to +13
{{< if-released "v26.38" >}}
{{< public-preview >}}
Arrangement dictionary compression
{{< /public-preview >}}
{{< /if-released >}}

{{< warn-if-unreleased "v26.38" >}}

Starting in v26.38, dictionary compression will be available (as **public
preview**) for managed clusters. Dictionary compression reduces the memory that

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question, not a correction — this may well be deliberate.

if-released renders its inner content only when the named release page has released: true, and releases/v26.38.md is still released: false, so this preview label renders on no page today. I built it both ways with Hugo extended 0.152.2: as-is, the label appears 0 times site-wide while the unreleased banner renders once on each of the three including pages; flipping released: true in a scratch build gives the exact mirror — label once per page, banner gone. So if the intent is that the banner carries the message before release and the label takes over after, that hand-off does work.

Two post-release wrinkles worth deciding on:

  1. "will be available" stays in the future tense once v26.38 ships.
  2. "(as public preview)" then sits directly under the label that has just started rendering — the same prose-plus-label duplication that led to availability.md being folded in here earlier in this review.

Was the tense meant to be revisited when the release lands? If not, one option is dropping "(as public preview)" from the sentence and making it tense-neutral, so it reads correctly on both sides of the release and the label carries the preview claim on its own.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants