Steps to drop the columns:
- Make sure maintenance has finished and data has been migrated
- Change PK:
```
ALTER TABLE pagelinks DROP PRIMARY KEY, ADD PRIMARY KEY (`pl_from`, `pl_target_id`);
```
- Stop writing to the old columns
- Make communications if needed
- Drop the columns and indexes:
```
ALTER TABLE pagelinks DROP COLUMN pl_namespace, DROP COLUMN pl_title;
DROP INDEX pl_namespace ON pagelinks;
DROP INDEX pl_backlinks_namespace ON pagelinks;
optimize table pagelinks;
```
Progress of PK change:
[] s1: Done everywhere except dc masters
[] s2: NOT YET
[] s3: Done everywhere except eqiad master
[x] s4: Done
[x] s5: Done
[] s6: Done everywhere except eqiad master
[] s7: Done everywhere except eqiad master
[] s8: Done everywhere except dc masters
[] labtestwiki
Progress of dropping the columns:
[] s1: NOT YET
[] s2: NOT YET
[] s3: NOT YET
[] s4: Done everywhere except dc masters
[] s5: NOT YET
[] s6: NOT YET
[] s7: NOT YET
[] s8: NOT YET
[] labtestwiki
Impact:
- Changing PK:
- s1: Drops ~150GB from each replica
- s5: Drops ~80GB from each replica.
- s3: 150-160GB dropped from each replica.
- s4: ~90GB dropped from each replica.
- s6: ~90GB dropped from each replica.
- s7: ~170GB dropped from each replica (https://grafana.wikimedia.org/d/000000377/host-overview?orgId=1&var-server=db2121&var-datasource=thanos&var-cluster=mysql&viewPanel=28&from=1711369820705&to=1711461258205)
- s8: ~110GB dropped from each replica.
- Dropping the columns
- s4: ~80GB