The query was slow. The table was fine. The problem was the schema.
Adding a new column to a production database can be fast, safe, and reversible. It can also take down your system if done wrong. The difference is the method.
A new column changes the schema definition. In small tables, this is instant. In large tables, it can block writes or lock rows for minutes—or hours. In high-traffic systems, that is not acceptable.
The best approach is to make the change without blocking queries. Many databases, like PostgreSQL, allow adding a new column with a default of NULL in constant time. Setting a non-null default or recalculating values on creation will rewrite the whole table, causing downtime. Instead, add the column as nullable, deploy, and backfill data in controlled batches. Then add constraints once it is safe.