A computer-implemented method comprising: receiving a request to perform a query with a recursive clause; generating a temporary table for a first set of results, wherein the temporary table comprises a plurality of segments, each segment being associated with a respective process of a plurality of processes that execute database operations in parallel; performing, by the plurality of processes in parallel, a first iteration of the recursive clause to generate the first set of results; indicating the first set of results as being associated with the first iteration of the recursive clause; storing the first set of results in the temporary table, wherein each process of the plurality of processes stores results generated by the respective process in the segment associated with the respective process; for one or more additional iterations, each respective process of the plurality of processes: retrieving, from the segment associated with the respective process, a set of results from a previous iteration based on an indication that associates the set of results with the previous iteration; indicating a respective additional set of results as being associated with the respective additional iteration; and appending the respective additional set of results to the respective segment associated with the respective process that produced the respective additional set of results. receiving a request to perform a query with a recursive clause; generating a temporary table for a first set of results, wherein the temporary table comprises a plurality of segments, each segment being associated with a respective process of a plurality of processes that execute database operations in parallel; comprises a plurality of segments, each segment being associated with a respective process of a plurality of processes that execute database operations in parallel; performing, by the plurality of processes in parallel, a first iteration of the recursive clause to generate the first set of results; indicating the first set of results as being associated with the first iteration of the recursive clause; storing the first set of results in the temporary table, wherein each process of the plurality of processes stores results generated by the respective process in the segment associated with the respective process; for one or more additional iterations, each respective process of the plurality of processes: retrieving, from the segment associated with the respective process, a set of results from a previous iteration based on an indication that associates the set of results with the previous iteration; indicating a respective additional set of results as being associated with the respective additional iteration; and appending the respective additional set of results to the respective segment associated with the respective process that produced the respective additional set of results. retrieving, from the segment associated with the respective process, a set of results from a previous iteration based on an indication that associates the set of results with the previous iteration; indicating a respective additional set of results as being associated with the respective additional iteration; and appending the respective additional set of results to the respective segment associated with the respective process that produced the respective additional set of results.