catalog: elide generated views inserted by other generators from mz_builtin_views - #38705
Draft
ggevay wants to merge 1 commit into
Draft
catalog: elide generated views inserted by other generators from mz_builtin_views#38705ggevay wants to merge 1 commit into
ggevay wants to merge 1 commit into
Conversation
…uiltin_views mz_builtin_views lists every builtin view's definition and create_sql as string literals, except for the generated VALUES views, which get a placeholder because their text is a mechanically produced list of every builtin and would be embedded a second time. The elision list was fixed to the three views built next to it, so mz_object_dependencies_raw, a generated view inserted by another generator, was embedded verbatim: 1.9 MB of the catalog dump, more than the view itself. Elide it by name, and keep the names of such views in one constant so the next generated view is added there. Part of SQL-689. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
ggevay
force-pushed
the
gabor/elide-generated-builtin-views
branch
from
September 7, 2026 19:34
d2affa9 to
dce58ad
Compare
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
mz_builtin_viewsembeds every builtin view'sdefinitionandcreate_sqlas literals, and replaces the text of the generatedVALUESviews with a placeholder, since their SQL is a mechanically produced list of every builtin and would otherwise be embedded a second time. The elision list was hardcoded to the three views generated next to it, somz_object_dependencies_raw(#38252), a generated view inserted by another generator before this one runs, was embedded verbatim: 1.9 MB of the compact catalog dump, larger than the view itself, and about half of the dump growth between v26.40.1 and v26.41.0-rc.4. Part of SQL-689.Description
make_builtin_viewstakes a slice instead of a fixed-size array, andbuiltins()extends the elision list with every view inbuiltin_itemswhose name is in a newGENERATED_BUILTIN_VIEWSconstant, currentlymz_object_dependencies_raw. Unlike the three views generated next to it, such a view is also yielded by the iterator overbuiltin_items, somake_builtin_viewsnow skips generated views when emitting the full-definition rows; each view appears exactly once. The elided view keeps its row inmz_builtin_views; only itsdefinitionandcreate_sqlbecome the placeholder, as for the existing generated views.test/sqllogictest/mz_views.sltlists the elided views and now includes it.Verification
bin/sqllogictest --optimizedonmz_views.slt,mz_object_dependencies.slt,oid.slt,catalog_server_explain.slt,information_schema_tables.sltandmz_catalog_server_index_accounting.sltpasses (433 of 433 statements; the dependency counts, the 194-row constant plan and the oid list are the checks that would catch a duplicated or missing row).cargo clippy -p mz-catalog --all-targets -- -D warningsis clean.🤖 Generated with Claude Code