1. A method comprising: receiving a database statement that requires a second data structure to be generated based on a first data structure; in response to receiving the database statement, generating the second data structure; while generating the second data structure, receiving a plurality of database statements that require a plurality of changes to be made to the first data structure; recording the plurality of changes in a third data structure; after the second data structure is generated, receiving a particular database statement that requires a particular change to the first data structure; determining whether one or more changes, of the plurality of changes recorded in the third data structure, would affect the same data in the second data structure that the particular change would affect if the particular change were applied to the second data structure; in response to determining that one or more changes, of the plurality of changes recorded in the third data structure, would affect the same data in the second data structure, removing the one or more changes the third data structure; and applying the particular change to the second data structure; wherein the method is performed by one or more computing devices.