4 ms·
^^^^ This. A thousand times, this. ^^^^^ As a supporting example of the arguments, I recently had to replace a subtly corrupted table in production with one re
by jyounker 8y ago
^^^^ This. A thousand times, this. ^^^^^
As a supporting example of the arguments, I recently had to replace a subtly corrupted table in production with one rebuilt from trusted sources. The table was about 160k rows and core to the operation of the production system I work on.
The initial "easy" approach to replacing this table took many hours to execute, and locked the table for much of that time. It took a day or two of effort, but the final series of SQL operations pushed the total run time down to less than four minutes, was recoverable from any intermediate state, and pushed the locking time down to three seconds.
The complicated part was not the final state of the database, but finding a path to reach that state that fit within the operational constraints.