Skip to content

Docs: document ALTER DATABASE ... MODIFY SETTING - #131085

Merged
dhtclk merged 2 commits into
masterfrom
codex/docs-alter-database-settings
Nov 12, 2026
Merged

dhtclk merged 2 commits into
masterfrom
codex/docs-alter-database-settings

Conversation

@dhtclk

@dhtclk dhtclk commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

ALTER DATABASE ... MODIFY SETTING is implemented but has no dedicated SQL reference entry. Add its source documentation with syntax, the required privilege, engine-specific restrictions, and an Atomic example using max_tables. Link it from the ALTER overview and reference navigation.

The new page contains frontmatter and empty generation markers; the dedicated documentation autogeneration workflow will populate its body from the source documentation.

Validation: git diff --check, navigation JSON parsing, documentation link targets, heading anchors, and the page title matching the statement registration. No build or runtime tests were run for this documentation-only change.

Changelog category (leave one):

  • Documentation (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Document ALTER DATABASE ... MODIFY SETTING in the SQL reference.


Workflow [PR]
Sync PR [sync-upstream/pr/131085]

Version info

  • Merged into: 26.11.1.2143-master (included in 26.11 and later)

@mintlify

mintlify Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
ClickHouse-docs 🟢 Ready View Preview Nov 12, 2026, 4:27 PM

@clickhouse-gh

clickhouse-gh Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [698f016]

Summary: ✅


AI Review

Summary

PR #131085 documents ALTER DATABASE ... MODIFY SETTING through its parser registration, adds the reference-page stub and navigation entry, and updates the expected system.statements entries. No actionable findings at head 698f016d82f32d6c7245e40848336c94548d2e91.

Final Verdict

Status: ✅ Approve.

@clickhouse-gh clickhouse-gh Bot added the pr-documentation Documentation PRs for the specific code PR label Nov 12, 2026
@clickhouse-gh clickhouse-gh Bot added the comp-documentation Documentation (docs, examples, READMEs). label Nov 12, 2026
@Blargian

Copy link
Copy Markdown
Member

@groeneai could you check if there are any other statements like this one that we are missing?

@clickhouse-gh

clickhouse-gh Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 698f016d8 with master 6618395f5 (stripped binary size, per-symbol sizes and ThinLTO time; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Slowest function optimization changes (ThinLTO)

Median per-function time ratio to the master baseline: programs/clickhouse ×0.63, programs/clickhouse-keeper ×0.63 (each binary is linked separately, on a different machine and with different build flags); deltas below are relative to it.

Binary Function Master PR Δ vs median
programs/clickhouse DB::registerFunctionConversion(DB::FunctionFactory&) 5.6 s 11.2 s +7.7 s (+220%)
programs/clickhouse _ZN6detail10static_forITk7is_enumN2DB23AttributeUnderlyingTypeEZNS1_29callOnDictionaryAttributeType… 3.3 s 8.1 s +6.0 s (+290%)
Compile time of recompiled translation units

7 translation units recompiled, 6 s compile time in total, 7 of them have a recent master baseline.

Job report

@dhtclk
dhtclk added this pull request to the merge queue Nov 12, 2026
Merged via the queue into master with commit 92793e1 Nov 12, 2026
204 checks passed
@dhtclk
dhtclk deleted the codex/docs-alter-database-settings branch November 12, 2026 22:39
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 12, 2026
@groeneai

Copy link
Copy Markdown
Collaborator

I compared what the parser accepts on master (ParserQuery, ASTAlterCommand::Type, ASTSystemQuery::Type, the SHOW, KILL and EXPLAIN parsers) with system.statements, i.e. the registrations the reference pages are generated from. Every statement below parses on master (checked with formatQuery) and is not covered by any registration. Where a non-reference page already describes it, I name that page.

No reference page at all

  • CREATE WORKLOAD, DROP WORKLOAD, CREATE RESOURCE, DROP RESOURCE: only in concepts/features/configuration/server-config/workload-scheduling.mdx.
  • BACKUP, RESTORE: only in concepts/features/backup-restore/.
  • CREATE INDEX name ON t (expr) TYPE ... and DROP INDEX name ON t: the standalone forms. ALTER TABLE ... INDEX documents only the ALTER form.
  • BEGIN TRANSACTION, COMMIT, ROLLBACK, SET TRANSACTION SNAPSHOT, EXPLAIN CURRENT TRANSACTION: only in concepts/features/operations/insert/transactions.mdx (experimental).
  • DESCRIBE FILESYSTEM CACHE 'name': only in storing-data.mdx and system-tables/filesystem_cache.mdx.

Missing from an existing page

  • ALTER TABLE ... EXECUTE <command>(...) (for example Iceberg expire_snapshots): only on the iceberg table function page.
  • ALTER TABLE ... UNLOCK SNAPSHOT and SYSTEM UNLOCK SNAPSHOT: only in backup-restore/snapshot.mdx.
  • KILL TRANSACTION, KILL PART_MOVE_TO_SHARD: the KILL page has only QUERY and MUTATION.
  • SHOW PRIVILEGES, SHOW MASKING POLICIES: absent from SHOW (it has SHOW CREATE MASKING POLICY).
  • SYSTEM, no section: FLUSH ASYNC INSERT QUEUE, CLEAR SCHEMA CACHE [FOR ...] (only the FORMAT and AVRO schema caches have sections), JEMALLOC PURGE, JEMALLOC ENABLE|DISABLE|FLUSH PROFILE, RESTART DISK, RECONNECT ZOOKEEPER, RESET DDL WORKER, START|STOP CLEANUP, START|STOP VIRTUAL PARTS UPDATE, START|STOP REDUCE BLOCKING PARTS, RELOAD DELTA KERNEL TRACING <level>, WAIT QUERY RUNNER (described on the QueryRunner engine page), SYNC TRANSACTION LOG (named in the syntax summary only), SCHEDULE MERGE and SYNC MERGES (they need the experimental merge_selector_algorithm = 'manual').

Probably fine to leave out

  • Test or debug helpers: SYSTEM SET COVERAGE TEST, RESET COVERAGE, START|STOP THREAD FUZZER, ALLOCATE MEMORY, FREE MEMORY, TEST VIEW, SUSPEND, WAIT BLOBS CLEANUP.
  • SNAPSHOT ... TO ... and SYSTEM DROP CATALOG REPLICA parse, but open-source builds cannot execute them (Unknown type of query: SnapshotQuery, Unknown type of SYSTEM query). SYSTEM REPLICA READY|UNREADY throws Not implemented.
  • COPY ... TO STDOUT runs only over the PostgreSQL wire protocol (Unknown type of query: CopyQuery everywhere else), so the PostgreSQL interface page may be a better home for it than the statement reference.

@Blargian

Copy link
Copy Markdown
Member

I compared what the parser accepts on master (ParserQuery, ASTAlterCommand::Type, ASTSystemQuery::Type, the SHOW, KILL and EXPLAIN parsers) with system.statements, i.e. the registrations the reference pages are generated from. Every statement below parses on master (checked with formatQuery) and is not covered by any registration. Where a non-reference page already describes it, I name that page.

No reference page at all

  • CREATE WORKLOAD, DROP WORKLOAD, CREATE RESOURCE, DROP RESOURCE: only in concepts/features/configuration/server-config/workload-scheduling.mdx.
  • BACKUP, RESTORE: only in concepts/features/backup-restore/.
  • CREATE INDEX name ON t (expr) TYPE ... and DROP INDEX name ON t: the standalone forms. ALTER TABLE ... INDEX documents only the ALTER form.
  • BEGIN TRANSACTION, COMMIT, ROLLBACK, SET TRANSACTION SNAPSHOT, EXPLAIN CURRENT TRANSACTION: only in concepts/features/operations/insert/transactions.mdx (experimental).
  • DESCRIBE FILESYSTEM CACHE 'name': only in storing-data.mdx and system-tables/filesystem_cache.mdx.

Missing from an existing page

  • ALTER TABLE ... EXECUTE <command>(...) (for example Iceberg expire_snapshots): only on the iceberg table function page.
  • ALTER TABLE ... UNLOCK SNAPSHOT and SYSTEM UNLOCK SNAPSHOT: only in backup-restore/snapshot.mdx.
  • KILL TRANSACTION, KILL PART_MOVE_TO_SHARD: the KILL page has only QUERY and MUTATION.
  • SHOW PRIVILEGES, SHOW MASKING POLICIES: absent from SHOW (it has SHOW CREATE MASKING POLICY).
  • SYSTEM, no section: FLUSH ASYNC INSERT QUEUE, CLEAR SCHEMA CACHE [FOR ...] (only the FORMAT and AVRO schema caches have sections), JEMALLOC PURGE, JEMALLOC ENABLE|DISABLE|FLUSH PROFILE, RESTART DISK, RECONNECT ZOOKEEPER, RESET DDL WORKER, START|STOP CLEANUP, START|STOP VIRTUAL PARTS UPDATE, START|STOP REDUCE BLOCKING PARTS, RELOAD DELTA KERNEL TRACING <level>, WAIT QUERY RUNNER (described on the QueryRunner engine page), SYNC TRANSACTION LOG (named in the syntax summary only), SCHEDULE MERGE and SYNC MERGES (they need the experimental merge_selector_algorithm = 'manual').

Probably fine to leave out

  • Test or debug helpers: SYSTEM SET COVERAGE TEST, RESET COVERAGE, START|STOP THREAD FUZZER, ALLOCATE MEMORY, FREE MEMORY, TEST VIEW, SUSPEND, WAIT BLOBS CLEANUP.
  • SNAPSHOT ... TO ... and SYSTEM DROP CATALOG REPLICA parse, but open-source builds cannot execute them (Unknown type of query: SnapshotQuery, Unknown type of SYSTEM query). SYSTEM REPLICA READY|UNREADY throws Not implemented.
  • COPY ... TO STDOUT runs only over the PostgreSQL wire protocol (Unknown type of query: CopyQuery everywhere else), so the PostgreSQL interface page may be a better home for it than the statement reference.

@groeneai Please add this documentation. Make sure to mention on a page when something is experimental and which version it was introduced in.

@groeneai

Copy link
Copy Markdown
Collaborator

Acknowledged. I'm working on reference documentation for the statements in that list, stating on each page when a statement is experimental (with the setting that enables it) and the version it was introduced in. Given the number of statements, I'll split it into a few PRs by statement family and link them here.

@groeneai

Copy link
Copy Markdown
Collaborator

I opened #131653 for CREATE/DROP WORKLOAD, CREATE/DROP RESOURCE and the standalone CREATE INDEX/DROP INDEX ... ON (3 of the 5 PRs for the list in #131085 (comment)).

@groeneai

Copy link
Copy Markdown
Collaborator

The first docs PR is open: #131664

It adds a BEGIN TRANSACTION page (with START TRANSACTION, COMMIT, ROLLBACK and SET TRANSACTION SNAPSHOT) and sections for KILL TRANSACTION, KILL PART_MOVE_TO_SHARD and EXPLAIN CURRENT TRANSACTION. Each one says whether it is experimental and which setting enables it, and gives the version it was introduced in, checked against the release tags.

The other families follow as four separate PRs, and I will post each link here: the SYSTEM statements; workloads, resources and standalone CREATE INDEX / DROP INDEX; BACKUP / RESTORE and UNLOCK SNAPSHOT; the remaining ALTER, SHOW, DESCRIBE FILESYSTEM CACHE and COPY ... TO STDOUT forms.

I am leaving out the test and debug helpers, SNAPSHOT ... TO ... and SYSTEM DROP CATALOG REPLICA (the open-source server rejects them as an unknown query type), and SYSTEM REPLICA READY|UNREADY (it throws Not implemented).

@groeneai

Copy link
Copy Markdown
Collaborator

I opened #131673 for ALTER TABLE ... EXECUTE, ALTER TABLE ... MOVE PART ... TO SHARD, SHOW PRIVILEGES, SHOW MASKING POLICIES, DESCRIBE FILESYSTEM CACHE and the PostgreSQL-protocol COPY ... TO STDOUT / COPY ... FROM STDIN (5 of the 5 PRs for the list in #131085 (comment)). MOVE PART ... TO SHARD (experimental) and COPY ... FROM STDIN were missing from my earlier list.

@groeneai

Copy link
Copy Markdown
Collaborator

I opened #131672 for BACKUP, RESTORE and ALTER TABLE ... UNLOCK SNAPSHOT (4 of the 5 PRs for the list in #131085 (comment)). BACKUP ... FROM SNAPSHOT and ALTER TABLE ... UNLOCK SNAPSHOT are marked experimental and ClickHouse Cloud only; their Cloud behaviour is written from the snapshot guide and the source, so that wording may need a check.

@groeneai

Copy link
Copy Markdown
Collaborator

I opened #131679 for the SYSTEM statements (2 of the 5 PRs for the list in #131085 (comment)). SCHEDULE MERGE, SYNC MERGES, UNLOCK SNAPSHOT and SYNC TRANSACTION LOG are marked experimental; VIRTUAL PARTS UPDATE, REDUCE BLOCKING PARTS and UNLOCK SNAPSHOT are marked ClickHouse Cloud only, written from in-tree text, so please correct that if it is wrong.

lazerg pushed a commit to lazerg/ClickHouse that referenced this pull request Nov 15, 2026
Add sections to the SYSTEM reference page (documentation["SYSTEM"] in
ParserSystemQuery.cpp) for the statements that parse but had no section:
RELOAD DELTA KERNEL TRACING, RESTART DISK, CLEAR|DROP SCHEMA CACHE,
FLUSH ASYNC INSERT QUEUE, RECONNECT ZOOKEEPER, RESET DDL WORKER,
JEMALLOC PURGE / FLUSH PROFILE / ENABLE|DISABLE PROFILE, SCHEDULE MERGE,
SYNC MERGES, STOP|START CLEANUP, STOP|START VIRTUAL PARTS UPDATE,
STOP|START REDUCE BLOCKING PARTS, UNLOCK SNAPSHOT, WAIT QUERY RUNNER and
SYNC TRANSACTION LOG, and their forms to the syntax summary.

Each section has an "Introduced in" line (the first release whose
ASTSystemQuery.h has the statement), the ExperimentalBadge where the
statement needs an experimental setting, a Cloud-only note for the three
statements that do nothing or fail in open-source builds, and the
required privilege. Every behaviour sentence was observed on a server
built from this branch.

Related: ClickHouse#131085

Co-Authored-By: Claude Opus 5.5 <[email protected]>
lazerg pushed a commit to lazerg/ClickHouse that referenced this pull request Nov 15, 2026
- RESTART DISK was introduced in 21.6 (the first 21.6 release tag,
  v21.6.2.7-prestable, has it; v21.5.9.4-stable does not).
- RESET DDL WORKER only requests the reset: the DDLWorker thread
  performs it later, the statement returns at once.
- UNLOCK SNAPSHOT and JEMALLOC FLUSH PROFILE state their own privilege.
- SCHEDULE MERGE: the parts must be adjacent parts of one partition, in
  order; a list that is not is never merged and holds back the merges
  scheduled after it (ManualMergeSelector selects only a contiguous run
  of one parts range and stops at the first entry it cannot select).

Related: ClickHouse#131085

Co-Authored-By: Claude Opus 5.5 <[email protected]>
lazerg pushed a commit to lazerg/ClickHouse that referenced this pull request Nov 15, 2026
- FLUSH ASYNC INSERT QUEUE: with a table list the statement waits only for the
  batches it takes from the queue itself (AsynchronousInsertQueue::flush), while
  flushAll also waits for in-flight flushes and the pool; an insert whose data
  does not parse is dropped and logged to system.asynchronous_insert_log, and the
  statement still succeeds (observed).
- SCHEDULE MERGE: TTL merges are chosen before the manual selector
  (MergeSelectorApplier::chooseMergesFrom), so they still run on a 'Manual'
  table (observed TTLDropMerge); a scheduled range must also pass the regular
  merge size constraints (checkPreparedRangeAgainstConstraints, observed with
  max_bytes_to_merge_at_max_space_in_pool = 1); the schedule lives in a
  process-local registry and is lost on restart (observed: SYNC MERGES returns
  at once after a restart, parts unmerged).
- STOP|START CLEANUP: CloudNotSupportedBadge, StorageSharedMergeTree has no
  ActionLocks::Cleanup lock.
- UNLOCK SNAPSHOT: the FROM destination is authorized against SOURCES grants
  (READ on S3/AZURE), like RESTORE.

Related: ClickHouse#131085

Co-Authored-By: Claude Opus 5.5 <[email protected]>
lazerg pushed a commit to lazerg/ClickHouse that referenced this pull request Nov 15, 2026
- RESTART DISK: refreshDataPartsOnce only adds the parts that appeared since
  the last scan (it seeds parts absent from data_parts_by_info) and does not
  detect removed ones (observed: a part dropped by the writer stays in the
  read-only reader's system.parts after the statement).
- SCHEDULE MERGE: the ManualMergeSelector registry is keyed by database, table
  and uuid and renameInMemory does not re-key it, so a table or database rename
  also loses the schedule (observed: SYNC MERGES returns at once after either
  rename, parts unmerged).
- UNLOCK SNAPSHOT: a FROM destination given as a named collection is resolved
  through BackupInfo::getNamedCollection, which also checks NAMED COLLECTION.

Related: ClickHouse#131085

Co-Authored-By: Claude Opus 5.5 <[email protected]>
lazerg pushed a commit to lazerg/ClickHouse that referenced this pull request Nov 15, 2026
- SCHEDULE MERGE: the ManualMergeSelector registry entry is keyed by database,
  table and uuid and is erased only when the table is dropped, so a rename does
  not lose the schedule: it is not performed under the new name and applies
  again once the table gets its old name back (observed for both a table and a
  database rename: no merge under the new name, the scheduled merge runs at
  once after the rename back).
- STOP CLEANUP: getCleanupLock only cancels the blocker, which the cleanup
  thread checks before each iteration, so a running iteration finishes after
  the statement returns (observed with the
  storage_merge_tree_background_clear_old_parts_pause fail point: the grabbed
  parts were removed after STOP CLEANUP, later outdated parts stayed).
  Statements such as DROP PART remove outdated parts themselves, so only the
  background cleanup is described as stopped.

Related: ClickHouse#131085

Co-Authored-By: Claude Opus 5.5 <[email protected]>
lazerg pushed a commit to lazerg/ClickHouse that referenced this pull request Nov 15, 2026
- JEMALLOC FLUSH PROFILE: InterpreterSystemQuery::execute hands any query with
  ON CLUSTER to executeDDLQueryOnCluster before building the filename
  pipeline, so each server writes its own profile file and the initiator
  returns the distributed DDL status, as selected by
  distributed_ddl_output_mode (observed: header host, port, status, error,
  num_hosts_remaining, num_hosts_active, no filename; nothing with `none`;
  the server still wrote its .heap file).
- RELOAD DELTA KERNEL TRACING: without USE_PARQUET && USE_DELTA_KERNEL_RS the
  statement throws SUPPORT_IS_DISABLED "Delta Kernel support is not enabled",
  the same note the JEMALLOC sections carry for builds without jemalloc.

Related: ClickHouse#131085

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-documentation Documentation (docs, examples, READMEs). pr-documentation Documentation PRs for the specific code PR pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants