1. 15

  2. 5

    I like this, and as a DBA will refer my developers to it, but I dislike the word “unsafe”. Maybe it’s the DBA in me, but “unsafe” implies danger to your data, not just to performance. None of these operations will harm your data in any way.

    That said, I don’t have a great replacement word. “Blocking”? “Disruptive”? I’m not sure, really. But “unsafe” just doesn’t sit right with me.

    1. 2

      “Slow” or “nonperformant” come to mind.

      1. 2

        It isn’t safe in that it brings your business to a screeching halt. NSFB comes to mind (not safe for business).

        1. 1

          Given its specifically about high volume, I’d say performance is part of safety. It’s not a use I’m familiar with either but I like it

        2. 2

          Interesting. So for example, adding a column with a default value is “unsafe”, but both adding a column and adding a default value to an existing column are “safe”? Surprising behavior, this is good to know.

          1. 2

            I interpret “adding a column with a default value” to mean “adding a non-nullable column (with a default value)” since, as mentioned, it requires that every existing row be updated atomically. Adding a nullable column with a default value, or just a default value to an existing nullable column, requires no changes to existing rows and so can be done without locking the table.