SQL_CALC_FOUND_ROWS promises the total row count for free alongside a LIMITed page, in one query. The catch is that it forces MySQL to evaluate every matching row rather…
ALTER TABLE on 30 million rows blocks writes for 40 minutes, and checkout writes to that table. A shadow table, triggers, and a backfill paced by replication lag.