Hi,
I've got a table in my database where there can only be 1 row per non-identity attribute tuple. Whenever we insert a row, we first check to see if a row exists with those values, if not, we insert it, otherwise we use the ID from the existing row.
In the example below, there would be a Unique Index on (Id) and (Attr1, Attr2, Attr3)
+----+-------+-------+-------+
| Id | Attr1 | Attr2 | Attr3 |
+====+=======+=======+=======+
| 1 | A | A | B |
| 2 | B | A | B |
| 3 | C | A | B |
| 4 | D | A | B |
| 5 | E | A | B |
+----+-------+-------+-------+
What is this pattern called?