2 ms·
Answering question #1, an alter table command that adds a new column without a default value is essentially free. Even on a large table. Even if the table is
by btilly 9y ago
Answering question #1, an alter table command that adds a new column without a default value is essentially free. Even on a large table. Even if the table is busy. However altering an existing column, or inserting one with a default requires locking the whole table.
But adding a column is a much more common operation than anything else, so this gets rid of the biggest pain point.
- pauldix 9y agoThanks for the answer. Sounds like mileage may vary depending on the operation. For us, we've seen people frequently want to change data types (from int to float or vice versa). Although that more frequently pops up because they started out writing the wrong data and we don't require them to define a schema up front. In InfluxDB, adding tags, measurements or fields is a free operation and requires no downtime or even an alter operation. Just write the data in and you're good to got. It's different if you want to add that new thing, but also add it for all historical data. For that, you can do the historical backfill and then drop the old series that don't match. But I will admin that how the underlying series map to a columnar set is not made clear to the user. Maybe something we can provide in a more automated and understandable fashion in the future.