Re:SQLite 3.32
by calpaterson on Saturday May 23, 2020 @10:21AM
(#23283150)
Depends on the maturity of your schema - if it's all figured out based on your business domain it won't happen much. If you're still finding product-market fit (or equivalent) splitting a table into two happens sometimes.
[ Parent
| on HN ]
Re:SQLite 3.32
by HelloNurse on Saturday May 23, 2020 @12:50PM
(#23284426)
"Splitting" a table usually means creating two new ones and dropping the old one after migrating its content with a complex migration script followed by thorough testing. Dropping columns is not only abnormal (adding columns is far more common: features tent to be added, not removed, over time) but also a very crude tool.
Re:SQLite 3.32
by calpaterson on Saturday May 23, 2020 @01:20PM
(#23284692)
Well what I meant was: when you break one table out of another. The kind of thing that comes up when you learn that there's a one-to-many in the domain that you didn't know about when you started.
Re:SQLite 3.32
by james-mcelwain on Saturday May 23, 2020 @12:05PM
(#23284036)
There are also operational concerns here. Dropping columns may require rebuilding indices, which can have a high cost that isn't worth paying for just to keep the schema clean.
Re:SQLite 3.32
by globular-toast on Saturday May 23, 2020 @12:51PM
(#23284436)
Splitting a table into two doesn't involve dropping fields. You just create two new tables then drop the old one.