Skip to content

Commit

Permalink
schemachanger: cleanup unused indexID
Browse files Browse the repository at this point in the history
We don't use the indexID in `scop.AddIndexZoneConfig`; we
can remove it.

Epic: None

Release note: None
  • Loading branch information
annrpom committed Oct 17, 2024
1 parent 661366d commit e196b68
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}
1 change: 0 additions & 1 deletion pkg/sql/schemachanger/scop/immediate_mutation.go
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,6 @@ type AddTableZoneConfig struct {
type AddIndexZoneConfig struct {
immediateMutationOp
TableID descpb.ID
IndexID descpb.IndexID
Subzone zonepb.Subzone
SubzoneSpans []zonepb.SubzoneSpan
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ func init() {

return &scop.AddIndexZoneConfig{
TableID: this.TableID,
IndexID: this.IndexID,
Subzone: this.Subzone,
SubzoneSpans: this.SubzoneSpans,
}
Expand Down

0 comments on commit e196b68

Please sign in to comment.