If i create a unique constraint like this unique(colA, colB);
Does it create 2 indexes, 1 for each column? Or how does it actually work internally?
If i create a unique constraint like this unique(colA, colB);
Does it create 2 indexes, 1 for each column? Or how does it actually work internally?
It will create only one index on two columns and both the column combinedly can not contain duplicate in the entire table.
You can add multiple duplicates for colA but considering that the colB is different for each row having same colA and vice-versa.
colA colB
Tejash SO
Tejash SO1
Tejash SO2
Allowed
or
colA colB
SO1 TEJASH
SO2 TEJASH
SO3 TEJASH
is also allowed.