Altering/creating tables extended from CMDB is updating millions of rows for all records on all CMDB-extended tables.
- The CMDB table uses an extension model called table-per-partition (TPP).
- TPP stores all extended tables on a flat set of database tables called partitions.
- Since all tables are stored as one single-flattened partition, changing one column on one extended table has to alter all rows at the database level.
- This process is performed via an "online alter".
- This allows the alter to take place on a temporary table to avoid locking the entire CMDB hierarchy during the process.
- Although the CMDB table is not entirely locked, this process is still very time consuming.
- This is expected platform behavior.
- Although this is allowed, it is important to understand the extension models used by ServiceNow before performing database schema changes.
Documentation topic: Table flattening