Sorry,If I did not make myself clear enough.
- we have one table (structure: 2 columns: GUID (PK), RAW (NVARBINARY (NULLABLE))),
- it's filled up with data (around 80% of the whole database)
- we migrate the database (and during those steps, development also changed the structure of the RAW column to (NOT NULL)
- as far as I can imagine, in the Background the Database Management System (MS SQL) creates a copy of the RAW column which is NOT NULLable, and copies the values, as alse Drops the old column and rename it (at least that's what I would do)
In this case, the migration of the database leads to an "doubled" size of the database (even just temporary, because you can shrink it afterwards) and it takes some time.
My Suggestion was, not to change the structure , but add the CHECK CONSTRAINT (for not being NULL or 0).
The Response from development was:
- It's implemented like this, we do not care about space.
- the Database Management System performs better if the structure is changed, instead of keeping the old structure with the added CONSTRAINT.
My quetion was, because I do not know if the dbms really performs slower or the query optimizer cares more about the "structure" than "constraints" and i do not find something about it in the world wide web, if anyone can verify this Statement of development - regarding the performance.