-// Add an indexing hashvector to the relation using the nominated
-// column indexes being the value part. the key must be a clone of the
-// relation columns but with some columns reset.
-int relation_add_contraint(relation *r,tupleschema *key) {
- tupleschema *primary = (tupleschema *) r->content.type;
- if ( primary->arity != key->arity ) {
- return -1; // no good
- }
+// Add an indexing hashvector to the relation using the given column
+// flags with 1 indicating key column and 0 indicating value column.
+int relation_add_constraint(relation *r,...) {
+ va_list ap;
+ tupleschema *ts = (tupleschema *) r->content.type;
+ tuple *columns = (tuple*) calloc( ts->arity, sizeof( void* ) );