1. A method, including: storing, in a data storage system, at least one dataset including a plurality of records; and processing, in a data processing system coupled to the data storage system, multiple records of the plurality of records to produce codes representing data patterns in the multiple records, the processing including: for each of the multiple records in the plurality of records, associating with the record a code encoding a plurality of elements, wherein each element represents a state or property of a corresponding field or combination of fields as one of a set of element values, and, for at least one element of at least a first code, the number of element values in the set is smaller than the total number of data values that occur in the corresponding field or combination of fields over all of the plurality of records in the dataset; and determining one or more data patterns characterizing the multiple records based at least in part on the codes associated with the multiple records.