SCD Type | Description | Key Features |
|
Type 1 | Overwriting the existing data with new data, without keeping any history of the previous values. | - Overwrites Existing Data - No Historical Data - Simple Implementation |
|
Type 2 | Tracks historical data by creating new records for changes. 某行的一个值被修改,则在原始表上新加一行,让修改后的值成为一个独立新纪录。 | - New row for each change - Maintains full history - Uses surrogate keys |
|
Type 3 | Adding new columns to the existing table 通过新的列来表征变化。只能记录上一次的记录 | - New Columns for Historical Data - Limited History - Simple Structure |
|
Type 4 | Uses a separate historical table to track changes. 用独立的表用来存储历史数据。并注明change date。 | - Main table holds current data - Historical table holds old data - Simplifies main table structure |
|
Type 6 | Combines features of Types 1, 2, and 3. 基于SCD 1,2,3,同时显示生效时间,每次的历史记录, 并多一个flag表明哪个记录是生效的。 | - Maintains current and historical data - Uses flags and effective dates - Supports both overwriting and versioning |
|