Skip to content

Comments

feat: skip online DDL rewrite if it’s new table#26

Merged
tianzhou merged 1 commit intomainfrom
new_table
Sep 14, 2025
Merged

feat: skip online DDL rewrite if it’s new table#26
tianzhou merged 1 commit intomainfrom
new_table

Conversation

@tianzhou
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings September 14, 2025 15:47
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@tianzhou tianzhou merged commit c76a610 into main Sep 14, 2025
2 checks passed
@tianzhou tianzhou deleted the new_table branch October 23, 2025 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant