1. A system comprising: a processor configured to: access a graph comprising a plurality of nodes and at least one edge, each edge associating two of the plurality of nodes, each of the plurality of nodes being associated with at least one database operation or with data; determine a nesting level associated with the graph, the nesting level representing a degree of temporary storage to be allocated for intermediate output produced by the at least one database operation; and construct computer code corresponding to the graph in accordance with the nesting level.