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 random the 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 above category codes from 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 don' use non-data the key fields should be squeezed down until every bit counts for examplethe category codes should be changed to run from to alsothe checksum should be removed because it doesn' add any additional informationit' deliberately redundant various bit-twiddling techniques are appropriate for compressing the various fields in the key use all the data every part of the key (except non-dataas described aboveshould contribute to the hash function don' just use the first digits or some such expurgation the more data that contributes to the keythe more likely it is that the keys will hash evenly into the entire range of indices