Tutorials Courses Interview Prep (100 Q&A) AI Tools (50) Developer Tools (50) Tracks Pricing Plans Blog & Articles Contact Us
MySQL Tuning, Indexing & Concurrency 8-10 Years (Tech Lead) Medium Production Scenario

How do you safely rename a column or drop an index in MySQL production without taking locks?

Real-World Scenario / Incident Description

Dropping an unused index on a busy 80M row table caused application write queries to stall.

277 views • Updated 1 month ago

MySQL 8 Invisible Indexes & Online Drop

  1. Make Index Invisible First:
    ALTER TABLE orders ALTER INDEX idx_old_status INVISIBLE;
    
    Verifies if optimizer or queries degrade without that index.
  2. Drop Online:
    ALTER TABLE orders DROP INDEX idx_old_status, ALGORITHM=INPLACE, LOCK=NONE;
    
Related Concepts: #Online DDL #Index Management #Production Safety