Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR skips online DDL rewrites for indexes and constraints when they are being created on newly created tables, optimizing the database migration process by avoiding unnecessary concurrent operations.
- Skip online DDL rewrite for indexes on new tables
- Skip online DDL rewrite for constraints on new tables
- Track newly created tables to identify when rewrites can be skipped
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| testdata/diff/migrate/v5/plan.txt | Updated expected output to use regular CREATE INDEX instead of CREATE INDEX CONCURRENTLY |
| testdata/diff/migrate/v5/plan.sql | Updated SQL plan to use regular CREATE INDEX without concurrent operations |
| testdata/diff/migrate/v5/plan.json | Updated JSON plan structure to consolidate steps and remove wait directives |
| testdata/diff/migrate/v3/plan.txt | Updated expected output to use regular CREATE INDEX instead of CREATE INDEX CONCURRENTLY |
| testdata/diff/migrate/v3/plan.sql | Updated SQL plan to use regular CREATE INDEX without concurrent operations |
| testdata/diff/migrate/v3/plan.json | Updated JSON plan structure and version to consolidate steps |
| testdata/diff/create_table/add_table_no_online_rewrite/plan.txt | New test file for validating no online rewrite behavior |
| testdata/diff/create_table/add_table_no_online_rewrite/plan.sql | New test SQL plan for table creation without online operations |
| testdata/diff/create_table/add_table_no_online_rewrite/plan.json | New test JSON plan structure for table creation |
| testdata/diff/create_table/add_table_no_online_rewrite/old.sql | New test baseline with empty schema |
| testdata/diff/create_table/add_table_no_online_rewrite/new.sql | New test target schema with tables and indexes |
| testdata/diff/create_table/add_table_no_online_rewrite/diff.sql | New test diff file (empty) |
| testdata/diff/create_table/add_table_like/plan.txt | Updated expected output to use regular CREATE INDEX |
| testdata/diff/create_table/add_table_like/plan.sql | Updated SQL plan to use regular CREATE INDEX |
| testdata/diff/create_table/add_table_like/plan.json | Updated JSON plan structure and version |
| internal/plan/rewrite.go | Added logic to skip rewrites for indexes and constraints on newly created tables |
| internal/plan/plan.go | Added tracking of newly created tables in groupDiffs function |
| internal/ir/parser.go | Enhanced constraint name generation and column name extraction from CHECK expressions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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.
No description provided.