+ * \brief Add a key constraint to a \ref relation.
+ *
+ * \param r is the relation concerned.
+ *
+ * \param key is the constraint \ref tupleschema.
+ *
+ * \returns the index into the constraints \ref vector for the added
+ * constraint.
+ *
+ * This function adds a \ref hashvector with the provided \ref
+ * tupleschema as its item type. The \b key \ref tupleschema must be a
+ * clone of the \ref relation column schema with some (or all) value
+ * columns marked as \b 0. Such a \ref tupleschema may be obtained via
+ * the function \ref tupleschema_mask to clone the \ref relation
+ * content type (casted as \ref tupleschema*) and clear columns by
+ * their index.
+ *
+ * The constraint \ref hashvectors are used when tuples are added to
+ * the \ref relation so as to identify the already contained tuples
+ * that contradict the addition by means of having the same constraint
+ * key. The already contained tuples are then "knocked out" from the
+ * relation by the new addition.
+ *
+ * \see tupleschema_mask, relation_add
+ * \related relation