A wider key can distinguish rows.

highlighted = computed this step

Extra key column

Adding a tie-like extra column can make formerly matching tuples different.

extra key breaks tie\text{extra key breaks tie}

Read the wider key

The wider rule uses 3 key columns and finds 0 violations.

violations=0\text{violations}=0

UNIQUE constraint examples are tiny finite table checks; SQL dialect completeness, index implementation, locking, optimizer behavior, product behavior, and performance claims are out of scope.

Add one more key column: base rowsidemailregionplan1adaeastbasic2beneastpro3adawestbasic4NULLeasttrial5NULLwesttrial6cyeastbasic UNIQUE rulenamecolumnsuq_region_plan_id(region, plan, id) UNIQUE keys by source rowsourceinputkeykeyStatus0(1, ada, east, basic)(east, basic, 1)checkable1(2, ben, east, pro)(east, pro, 2)checkable2(3, ada, west, basic)(west, basic, 3)checkable3(4, NULL, east, trial)(east, trial, 4)checkable4(5, NULL, west, trial)(west, trial, 5)checkable5(6, cy, east, basic)(east, basic, 6)checkable UNIQUE violationsleftrightkeyreasonnonenonenonenone Insert candidate checkfieldvaluepresentno UNIQUE factsfactvaluerowCount6constraintNameuq_region_plan_idkeyColumnCount3violationCount0tableValidyesnullsCollideno_toy_SQL_like_conventioncandidateDecisionnone

Not a recommendation

This only shows the finite key check, not schema-design advice.

mechanism only\text{mechanism only}

Summary

A wider key can distinguish rows that a narrower key grouped together.

wider key\text{wider key}