Primary key and unique constraints are supported for RLV store loads, inserts and updates, in a specific way.
Because the RLV store does not maintain secondary indexes, enforcement requires a separate unique value checking process. Furthermore, no exclusive table lock is taken for RLV table writes, so new row values can be inserted, updated or deleted and subsequently committed by other connections while the current connection performs its operations.
Although RLV modifications committed after a transaction snapshot are not visible to the current connection, before any new values can be committed, any values added or removed due to those modifications are considered during unique and primary key checking, to avoid constraint violation.
Unique and primary key value checking has two phases.