[11:47:29] marostegui: stupid q: If I want to add a default to several columns in a really large table, can it be done live (or is it fast in any way?). I'm talking half a terabyte tables [11:48:18] (I want to stop writing to those columns and drop them later but they don't have default and are not nullable) [11:57:08] Amir1: the problem is it may take a small amount of time to apply, but if the table is read frequently may cause issues due to metadata locking if done all at the same time [11:58:00] explained at: https://wikitech.wikimedia.org/wiki/Schema_changes#Dangers_of_schema_changes [11:58:12] ah ok [11:58:23] in all cases the time can be tested on production [11:59:02] what it could solve is the need to do a master switch [11:59:24] so there is some advantage to do it like that, if it is instant [11:59:30] yeah, ok, I can do that [11:59:54] what table is it, out of curiosity? [12:00:07] to see if it would be heavy reads or not [12:00:45] externallinks [12:01:27] planning to drop el_to,el_index, and el_index_60 columns and four indexes that refer to them [12:01:38] my guess it would be in a middle ground between revision and 0 reads [12:01:41] but first I need to make them have default [12:01:55] test on the test hosts [12:02:03] *production test [12:02:15] yeah, but a lot of things also read it, e.g. abuse filter and spam blacklist reads it before every edit [12:02:28] with compression the availity to do instant alter tables it may be compromised [12:02:45] (technically speaking not every, only non-admins and non-bots) [12:02:50] so you may have a big NO fast :-( [12:03:06] oh :( [12:03:12] will find a way [12:03:21] in theory adding empty columns is instant but not sure under our setup [12:03:35] Amir1: sorry I was having lunch [12:03:40] in any case, what manuel says ^ [12:03:55] but first the migration of data needs to be done (still on going in for three large wikis) [12:03:56] just giving some extra thoughts [12:04:12] marostegui: no worries. I'm actually about to go get lunch [12:04:43] jynus: it's not adding empty column, it's setting the default value [12:05:00] yeah, I meant that too [12:05:15] ok :D [12:05:21] afk [12:05:34] in theory innodb has a feature to do instant addition of columns, but it may not work in our case [12:06:05] that's why I suggested testing and if it is a no, no worth spending more time on that :-D [12:06:10] The TL;DR is...metadata locking is unpredictable [12:07:15] yeah, mentioning it for master writes without switchover