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, at least some of the plurality of nodes being associated with at least one database operation; determine a nesting level associated with the graph, wherein the nesting level is a setting to specify a degree of temporary storage to be allocated for intermediate output produced by the at least one database operation; detect a query path in the graph, the query path including at least a first node and a second node of the plurality of interdependent nodes, wherein an output of the first node is an input for the second node; determine, based on the nesting level, whether the intermediate output produced by the at least one database operation should be produced using a nested query in the computer code or should be stored in a temporary storage area and retrieved therefrom; and construct computer code corresponding to the graph in accordance with the nesting level.