The complexity of global cardinality constraints (Logical Methods in Computer Science, 2010)