using compound unique constraints for dimension and element.