From e196b687afbe90aa8001c3f2c5c277f740523c5e Mon Sep 17 00:00:00 2001 From: Annie Pompa Date: Thu, 17 Oct 2024 10:46:16 -0400 Subject: [PATCH] schemachanger: cleanup unused indexID We don't use the indexID in `scop.AddIndexZoneConfig`; we can remove it. Epic: None Release note: None --- .../alter_index_configure_zone.explain | 4 ++-- ...ndex_configure_zone_multiple__statement_1_of_3.explain | 4 ++-- ...ndex_configure_zone_multiple__statement_2_of_3.explain | 6 +++--- ...ndex_configure_zone_multiple__statement_3_of_3.explain | 8 ++++---- pkg/sql/schemachanger/scop/immediate_mutation.go | 1 - .../scplan/internal/opgen/opgen_index_zone_config.go | 1 - 6 files changed, 11 insertions(+), 13 deletions(-) diff --git a/pkg/ccl/schemachangerccl/testdata/end_to_end/alter_index_configure_zone/alter_index_configure_zone.explain b/pkg/ccl/schemachangerccl/testdata/end_to_end/alter_index_configure_zone/alter_index_configure_zone.explain index 2fd8aee84199..9b5959d75289 100644 --- a/pkg/ccl/schemachangerccl/testdata/end_to_end/alter_index_configure_zone/alter_index_configure_zone.explain +++ b/pkg/ccl/schemachangerccl/testdata/end_to_end/alter_index_configure_zone/alter_index_configure_zone.explain @@ -11,7 +11,7 @@ Schema change plan for ALTER INDEX ‹defaultdb›.‹public›.‹t›@‹foo │ ├── 1 element transitioning toward PUBLIC │ │ └── ABSENT → PUBLIC IndexZoneConfig:{DescID: 104 (t), IndexID: 2 (foo), SeqNum: 1} │ └── 1 Mutation operation - │ └── AddIndexZoneConfig {"IndexID":2,"TableID":104} + │ └── AddIndexZoneConfig {"TableID":104} └── PreCommitPhase ├── Stage 1 of 2 in PreCommitPhase │ ├── 1 element transitioning toward PUBLIC @@ -22,4 +22,4 @@ Schema change plan for ALTER INDEX ‹defaultdb›.‹public›.‹t›@‹foo ├── 1 element transitioning toward PUBLIC │ └── ABSENT → PUBLIC IndexZoneConfig:{DescID: 104 (t), IndexID: 2 (foo), SeqNum: 1} └── 1 Mutation operation - └── AddIndexZoneConfig {"IndexID":2,"TableID":104} + └── AddIndexZoneConfig {"TableID":104} diff --git a/pkg/ccl/schemachangerccl/testdata/end_to_end/alter_index_configure_zone_multiple/alter_index_configure_zone_multiple__statement_1_of_3.explain b/pkg/ccl/schemachangerccl/testdata/end_to_end/alter_index_configure_zone_multiple/alter_index_configure_zone_multiple__statement_1_of_3.explain index 05d3ab8c2972..6622d909fab2 100644 --- a/pkg/ccl/schemachangerccl/testdata/end_to_end/alter_index_configure_zone_multiple/alter_index_configure_zone_multiple__statement_1_of_3.explain +++ b/pkg/ccl/schemachangerccl/testdata/end_to_end/alter_index_configure_zone_multiple/alter_index_configure_zone_multiple__statement_1_of_3.explain @@ -11,7 +11,7 @@ Schema change plan for ALTER INDEX ‹defaultdb›.‹public›.‹t›@‹foo │ ├── 1 element transitioning toward PUBLIC │ │ └── ABSENT → PUBLIC IndexZoneConfig:{DescID: 104 (t), IndexID: 2 (foo), SeqNum: 1} │ └── 1 Mutation operation - │ └── AddIndexZoneConfig {"IndexID":2,"TableID":104} + │ └── AddIndexZoneConfig {"TableID":104} └── PreCommitPhase ├── Stage 1 of 2 in PreCommitPhase │ ├── 1 element transitioning toward PUBLIC @@ -22,4 +22,4 @@ Schema change plan for ALTER INDEX ‹defaultdb›.‹public›.‹t›@‹foo ├── 1 element transitioning toward PUBLIC │ └── ABSENT → PUBLIC IndexZoneConfig:{DescID: 104 (t), IndexID: 2 (foo), SeqNum: 1} └── 1 Mutation operation - └── AddIndexZoneConfig {"IndexID":2,"TableID":104} + └── AddIndexZoneConfig {"TableID":104} diff --git a/pkg/ccl/schemachangerccl/testdata/end_to_end/alter_index_configure_zone_multiple/alter_index_configure_zone_multiple__statement_2_of_3.explain b/pkg/ccl/schemachangerccl/testdata/end_to_end/alter_index_configure_zone_multiple/alter_index_configure_zone_multiple__statement_2_of_3.explain index cfd192dd5bb3..55a38a0a8409 100644 --- a/pkg/ccl/schemachangerccl/testdata/end_to_end/alter_index_configure_zone_multiple/alter_index_configure_zone_multiple__statement_2_of_3.explain +++ b/pkg/ccl/schemachangerccl/testdata/end_to_end/alter_index_configure_zone_multiple/alter_index_configure_zone_multiple__statement_2_of_3.explain @@ -12,7 +12,7 @@ Schema change plan for ALTER INDEX ‹defaultdb›.‹public›.‹t›@‹foo │ ├── 1 element transitioning toward PUBLIC │ │ └── ABSENT → PUBLIC IndexZoneConfig:{DescID: 104 (t), IndexID: 2 (foo), SeqNum: 2} │ └── 1 Mutation operation - │ └── AddIndexZoneConfig {"IndexID":2,"TableID":104} + │ └── AddIndexZoneConfig {"TableID":104} └── PreCommitPhase ├── Stage 1 of 2 in PreCommitPhase │ ├── 2 elements transitioning toward PUBLIC @@ -25,5 +25,5 @@ Schema change plan for ALTER INDEX ‹defaultdb›.‹public›.‹t›@‹foo │ ├── ABSENT → PUBLIC IndexZoneConfig:{DescID: 104 (t), IndexID: 2 (foo), SeqNum: 1} │ └── ABSENT → PUBLIC IndexZoneConfig:{DescID: 104 (t), IndexID: 2 (foo), SeqNum: 2} └── 2 Mutation operations - ├── AddIndexZoneConfig {"IndexID":2,"TableID":104} - └── AddIndexZoneConfig {"IndexID":2,"TableID":104} + ├── AddIndexZoneConfig {"TableID":104} + └── AddIndexZoneConfig {"TableID":104} diff --git a/pkg/ccl/schemachangerccl/testdata/end_to_end/alter_index_configure_zone_multiple/alter_index_configure_zone_multiple__statement_3_of_3.explain b/pkg/ccl/schemachangerccl/testdata/end_to_end/alter_index_configure_zone_multiple/alter_index_configure_zone_multiple__statement_3_of_3.explain index 82cf275912b1..5aabaff16e48 100644 --- a/pkg/ccl/schemachangerccl/testdata/end_to_end/alter_index_configure_zone_multiple/alter_index_configure_zone_multiple__statement_3_of_3.explain +++ b/pkg/ccl/schemachangerccl/testdata/end_to_end/alter_index_configure_zone_multiple/alter_index_configure_zone_multiple__statement_3_of_3.explain @@ -13,7 +13,7 @@ Schema change plan for ALTER INDEX ‹defaultdb›.‹public›.‹t›@‹foo │ ├── 1 element transitioning toward PUBLIC │ │ └── ABSENT → PUBLIC IndexZoneConfig:{DescID: 104 (t), IndexID: 2 (foo), SeqNum: 3} │ └── 1 Mutation operation - │ └── AddIndexZoneConfig {"IndexID":2,"TableID":104} + │ └── AddIndexZoneConfig {"TableID":104} └── PreCommitPhase ├── Stage 1 of 2 in PreCommitPhase │ ├── 3 elements transitioning toward PUBLIC @@ -28,6 +28,6 @@ Schema change plan for ALTER INDEX ‹defaultdb›.‹public›.‹t›@‹foo │ ├── ABSENT → PUBLIC IndexZoneConfig:{DescID: 104 (t), IndexID: 2 (foo), SeqNum: 2} │ └── ABSENT → PUBLIC IndexZoneConfig:{DescID: 104 (t), IndexID: 2 (foo), SeqNum: 3} └── 3 Mutation operations - ├── AddIndexZoneConfig {"IndexID":2,"TableID":104} - ├── AddIndexZoneConfig {"IndexID":2,"TableID":104} - └── AddIndexZoneConfig {"IndexID":2,"TableID":104} + ├── AddIndexZoneConfig {"TableID":104} + ├── AddIndexZoneConfig {"TableID":104} + └── AddIndexZoneConfig {"TableID":104} diff --git a/pkg/sql/schemachanger/scop/immediate_mutation.go b/pkg/sql/schemachanger/scop/immediate_mutation.go index 7582dca3d14c..4359373285bb 100644 --- a/pkg/sql/schemachanger/scop/immediate_mutation.go +++ b/pkg/sql/schemachanger/scop/immediate_mutation.go @@ -1006,7 +1006,6 @@ type AddTableZoneConfig struct { type AddIndexZoneConfig struct { immediateMutationOp TableID descpb.ID - IndexID descpb.IndexID Subzone zonepb.Subzone SubzoneSpans []zonepb.SubzoneSpan } diff --git a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_index_zone_config.go b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_index_zone_config.go index 962c081453e7..3ff821265e01 100644 --- a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_index_zone_config.go +++ b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_index_zone_config.go @@ -19,7 +19,6 @@ func init() { return &scop.AddIndexZoneConfig{ TableID: this.TableID, - IndexID: this.IndexID, Subzone: this.Subzone, SubzoneSpans: this.SubzoneSpans, }