Repository navigation
Convert mz_columns and mz_index_columns to builtin mvs - #39427
Draft
SangJunBak wants to merge 13 commits into
Draft
SangJunBak wants to merge 13 commits into
SangJunBak wants to merge 13 commits into
Conversation
SangJunBak
force-pushed
the
jun/sql-494-convert-mz_columns-and-mz_index_columns-to-catalog-views
branch
from
October 6, 2026 19:49
a659af0 to
27c8872
Compare
SangJunBak
added this pull request to stack #38849
October 6, 2026 19:56
SangJunBak
force-pushed
the
jun/sql-494-convert-mz_columns-and-mz_index_columns-to-catalog-views
branch
from
October 9, 2026 15:29
27c8872 to
7857df2
Compare
SangJunBak
force-pushed
the
jun/sql-494-convert-mz_columns-and-mz_index_columns-to-catalog-views
branch
from
October 9, 2026 15:34
7857df2 to
3a32217
Compare
SangJunBak
force-pushed
the
jun/sql-494-convert-mz_columns-and-mz_index_columns-to-catalog-views
branch
from
October 13, 2026 17:38
3a32217 to
27a429d
Compare
SangJunBak
force-pushed
the
jun/sql-494-convert-mz_columns-and-mz_index_columns-to-catalog-views
branch
from
October 14, 2026 08:57
27a429d to
3c03c63
Compare
SangJunBak
force-pushed
the
jun/sql-494-convert-mz_columns-and-mz_index_columns-to-catalog-views
branch
4 times, most recently
from
October 14, 2026 14:40
2194479 to
ea159b9
Compare
SangJunBak
removed this pull request from stack #38849
October 14, 2026 14:41
SangJunBak
added this pull request to stack #39819
October 14, 2026 14:41
SangJunBak
removed this pull request from stack #39819
October 15, 2026 19:41
SangJunBak
changed the base branch from
jun/durable-column
to
jun/name-from-oid
October 15, 2026 19:42
SangJunBak
added this pull request to stack #39878
October 15, 2026 19:42
SangJunBak
force-pushed
the
jun/sql-494-convert-mz_columns-and-mz_index_columns-to-catalog-views
branch
2 times, most recently
from
October 15, 2026 22:01
38b4832 to
e10f1a1
Compare
SangJunBak
force-pushed
the
jun/sql-494-convert-mz_columns-and-mz_index_columns-to-catalog-views
branch
from
October 16, 2026 20:28
e10f1a1 to
35a9155
Compare
SangJunBak
force-pushed
the
jun/sql-494-convert-mz_columns-and-mz_index_columns-to-catalog-views
branch
from
October 16, 2026 21:15
35a9155 to
55ffa2d
Compare
parse_catalog_create_sql reports a table's DEFAULT clauses by column name, with the string 'NULL' for a column without one (matches current behavior), so that mz_columns can read them. Non-table rows have the actual null value for the default column.
SangJunBak
force-pushed
the
jun/sql-494-convert-mz_columns-and-mz_index_columns-to-catalog-views
branch
from
October 17, 2026 00:32
55ffa2d to
0b7ed13
Compare
SangJunBak
force-pushed
the
jun/sql-494-convert-mz_columns-and-mz_index_columns-to-catalog-views
branch
from
October 17, 2026 00:48
0b7ed13 to
f8af45f
Compare
The generated view lists the columns of every builtin relation, so that catalog views can reference the column information of builtin items in SQL.
mz_columns reads the ItemColumn rows each relation records in mz_catalog_raw: the recorded OID and type modifier present the type through mz_type_name, and a column of a CREATE TYPE list, map or record takes the name and OID of that type's item instead. A table's column defaults are the DEFAULT clauses of its create_sql, read through parse_catalog_create_sql. Builtin relations' columns come from mz_builtin_columns, joined to the builtin object mappings. The packer goes away, and the relation gets a replacement migration step. Part of SQL-494 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWJKdCnWF4iWnpNYVv3aRx
Plans, builtin object listings and OIDs change with mz_columns becoming a materialized view and with the generated mz_builtin_columns view. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWJKdCnWF4iWnpNYVv3aRx
The sqllogictest pins the schema, the builtin, introspection and user rows for every relation kind, and retraction. Its expectations were captured from the builtin table before the conversion and hold for the view, except that a table's defaults read as written. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWJKdCnWF4iWnpNYVv3aRx
The ItemColumns platform check creates tables, views, materialized views and indexes with column and expression keys in every phase, adds columns with ALTER TABLE, and comments on columns. It then checks what mz_columns and mz_index_columns report and that the reported positions join with the comments. In the upgrade scenarios the objects created before the upgrade get their recorded rows from the bootstrap refresh. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWJKdCnWF4iWnpNYVv3aRx
mz_columns.slt asserts on allocated item ids and type OIDs and lists every user object, which --auto-index-selects perturbs by creating wrapper views and indexes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWJKdCnWF4iWnpNYVv3aRx
parse_catalog_create_sql reports an index's key expressions in index order, so that mz_index_columns can read them. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWJKdCnWF4iWnpNYVv3aRx
The generated view lists the key columns of every builtin index, so that catalog views can reference them in SQL. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWJKdCnWF4iWnpNYVv3aRx
mz_index_columns reads the IndexColumn rows each index records, with the key expressions as written in create_sql. Builtin and introspection source index keys come from mz_builtin_index_columns, joined to the builtin index mappings and to the per-cluster introspection source index records. The packer goes away, and the relation gets a replacement migration step. Closes: SQL-494 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWJKdCnWF4iWnpNYVv3aRx
…view Plans, builtin object listings and OIDs change with mz_index_columns becoming a materialized view and with the generated mz_builtin_index_columns view. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWJKdCnWF4iWnpNYVv3aRx
The sqllogictest pins the builtin, introspection and user rows for every key shape, and retraction. Its expectations were captured from the builtin table before the conversion and hold for the view. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWJKdCnWF4iWnpNYVv3aRx
mz_index_columns.slt asserts on allocated item ids and lists every user object, which --auto-index-selects perturbs by creating wrapper views and indexes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWJKdCnWF4iWnpNYVv3aRx
SangJunBak
force-pushed
the
jun/sql-494-convert-mz_columns-and-mz_index_columns-to-catalog-views
branch
from
October 17, 2026 01:34
f8af45f to
3273714
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Closes SQL-494
Description
What does this PR actually do? Focus on the approach and any non-obvious
decisions. The diff shows the code --- use this space to explain what the
diff can't tell a reviewer.
Verification
How do you know this change is correct? Describe new or existing automated
tests, or manual steps you took.