Patent ID: 8533167

Claim:
A method for storing a cardinality of a plurality of unique items of data in a received data stream, the method comprising: storing, in a computer memory, unique data items in the form of an unsorted list; when the number of unique items stored in the computer memory crosses a first threshold, converting the items in the unsorted list into a linear counter executable by a processor, discarding the unsorted list from the computer memory, and causing the processor to count further unique items in the received data stream using the linear counter; and when the number of unique items stored in the computer memory crosses a second threshold, converting the data in the linear counter into a PCSA structure or log-log counter, discarding the linear counter from the computer memory, and causing the processor to count further unique items in the received data stream using the PCSA structure or log-log counter, wherein converting the data in the linear counter into the PCSA structure comprises inserting a plurality of random numbers into the PCSA structure.