1. A computer-implemented method for efficient calculation of sets of distinct results in an information retrieval service, the method comprising: receiving a query from a client application, the query having at least one requested attribute and one or more conditions; for each row identifier in a database table that matches the one or more conditions, calculating a tuple of value identifiers having an entry for each requested attribute; and assigning a unique number to the tuple for each distinct combination of the value identifiers.