The query was slow. You trace it to a missing index, but the bigger problem is the schema. You need a new column.
Adding a new column should be simple. In practice, it can lock tables, block writes, and bring down services if done without care. Schema changes are dangerous in production because database engines must rewrite data or update metadata for every row. The cost depends on table size, engine configuration, and concurrency.
Plan the new column before touching the database. Decide on the data type, constraints, default values, and whether it can be NULL. Know the impact on indexes. In PostgreSQL, adding a nullable column without a default is fast—it only changes metadata. Adding a column with a non-null default forces a full table rewrite. MySQL behaves differently depending on version and storage engine; some operations are instant, others are not.