Patent ID: 8825674

Claim:
A method comprising: in response to a request to sort data items, in descending order, based on values for a particular field of the data items: constructing an array of bytes, for each data item, that represents at least a complement of the value for the particular field of the data item; and sorting the data items as requested based on the arrays of bytes; wherein constructing the array of bytes, for each data item, includes: determining a first one or more bytes that represents the value for the particular field of the data item; and constructing a second one or more bytes that represents the complement of the value for the particular field of the data item by subtracting each of the first one or more bytes from a maximum byte value; wherein sorting the data items based on the arrays of bytes comprises performing byte-by-byte comparisons between pairs of the arrays of bytes, wherein the byte-by-byte comparison between a pair of the arrays of bytes proceeds until a byte value difference between the pair is identified or the ends of both arrays of bytes of the pair is reached; wherein the method is performed by one or more computing devices.