sql – Firebird. Unique. Constraint vs index

Question:

In Firebird 2.5, automatic control of the uniqueness of a subset of columns can be done in two different ways. Through restriction and through a unique index. The constraint is always implemented using an index.

The question is: When exactly is the limitation necessary?

In Firebird 2.5 Language Reference, it was limited to just one phrase:

A unique index is not a constraint.

Answer:

The constraint is checked immediately before inserting data into the table. Therefore, it works faster than just using a unique index.

Scroll to Top
AllEscort