In particular embodiments, a method includes receiving data sets, constructing a first binary decision diagram (BDD) representing the data sets, iteratively adding data from the data sets to the first BDD until a compression rate of the first BDD reaches a threshold compression rate, constructing a second BDD representing data from the data sets received after the compression rate of the first BDD equals a threshold compression rate, and iteratively adding data from the data sets to the second BDD.