hash tables random keys so-called perfect hash function maps every key into different table location this is only possible for keys that are unusually well behaved and whose range is small enough to be used directly as array indices (as in the employee-number example at the beginning of this in most cases neither of these situations existsand the hash function will need to compress larger range of keys into smaller range of index numbers the distribution of key values in particular database determines what the hash function needs to do in this we've assumed that the data was randomly distributed over its entire range in this situation the hash function index key arraysizeis satisfactory it involves only one mathematical operationand if the keys are truly randomthe resulting indices will be random tooand therefore well distributed non-random keys howeverdata is often distributed non-randomly imagine database that uses car-part numbers as keys perhaps these numbers are of the form -- this is interpreted as followsdigits - supplier number ( to currently up to digits - category code ( up to digits - month of introduction ( to digits - year of introduction ( to digits - serial number ( to but never exceeds digit toxic risk flag ( or digits - checksum (sum of other fieldsmodulo the key used for the part number shown would be , , , , , howeversuch keys are not randomly distributed the majority of numbers from to , , , , , can' actually occur (for examplesupplier numbers higher than category codes that aren' multiples of and months from to alsothe checksum is not independent of the other numbers some work should be done to these part numbers to help ensure that they form range of more truly random numbers