adapter: gate materialized view key forwarding behind a dyncfg#37655
Draft
antiguru wants to merge 1 commit into
Draft
adapter: gate materialized view key forwarding behind a dyncfg#37655antiguru wants to merge 1 commit into
antiguru wants to merge 1 commit into
Conversation
A materialized view's persisted RelationDesc records the unique keys the optimizer inferred from its plan. Downstream consumers (reduce elision, redundant join, join planning) trust these keys for correctness, but they are not stable: an optimizer change or a replacement materialized view can produce different real keys while dependents were planned against the old ones, yielding wrong results. Add the `enable_materialized_view_keys` dyncfg (default off). When off, both the creation and rehydration paths drop the inferred keys before they reach the persisted schema, so no consumer can rely on them. Nullability forwarding is unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
antiguru
force-pushed
the
bridge-cse_01QsjLpaYwbdVd6pzeS6X35G
branch
from
July 14, 2026 21:21
4a84a17 to
a2270e7
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.
A materialized view's persisted
RelationDescrecords the unique keys the optimizer inferred from its plan.Downstream consumers (reduce elision, redundant join, join planning) trust these keys for correctness.
These keys are not stable: an optimizer change or a replacement materialized view can produce different real keys while dependents were planned against the old ones, yielding wrong results.
Adds the
enable_materialized_view_keysdyncfg, default off.When off, both the creation and rehydration paths drop the inferred keys before they reach the persisted schema, so no consumer can rely on them.
Nullability forwarding is unaffected.
Motivation
Prevents unsound reliance on unstable optimizer-inferred materialized view keys.
Checklist
$T ⇔ Proto$Tmapping (possibly in a backwards-incompatible way), then it is tagged with aT-protolabel.