1. A method comprising: receiving a plurality of integration rules; accessing a first data set; generating a first representation of the first data set based on the plurality of integration rules, the first representation being flat and comprising a plurality of records; generating at least one index, the index encoding at least one hierarchical relationship among the plurality of records; generating a second representation of the first representation based on the at least one index, the second representation comprising nested data; and maintaining a data structure comprising a set of potential hierarchical relationships among the plurality of records.