Patent ID: 8631020

Claim:
A method for encoding data to be sorted, the method comprising: constructing, for each data item of a plurality of data items, an array of bytes that represents values for a plurality of fields of the each data item; wherein the plurality of fields comprises a variable width field and a fixed width field; wherein the plurality of data items includes a particular data item; wherein the particular data item comprises a first one or more bytes that represent the value for the variable width field of the particular data item; wherein the first one or more bytes comprises at least one byte having a particular value; wherein constructing the array of bytes for the particular data item includes: encoding the first one or more bytes to produce a first plurality of bytes that represent the value for the variable width field of the particular data item including adding, after each byte in the first one or more bytes having the particular value, a sequence of one or more bytes, wherein at least one byte of the sequence of one or more bytes does not have the particular value, and appending a sequence of two or more bytes, each having the particular value, to the first plurality of bytes to produce a second plurality of bytes that represent the value for the variable width field of the particular data item, and including the second plurality of bytes in the array of bytes constructed for the particular data item; and based on byte-wise comparisons between the arrays of bytes constructed for the plurality of data items, sorting the plurality of data items according to at least the values for the variable width field of the plurality of data items and the values for the fixed width field of the plurality of data items; wherein the method is performed by one or more computing devices.