1. A query execution system, comprising: a processor configured to facilitate execution of queries, wherein the queries comprise an iterate-aggregate shape query; an identification component configured to identify the iterate-aggregate shape query; an execution component configured to process the iterate-aggregate shape query recursively in parallel over multiple partitions of data; and an optimization component configured to: identify optimal partitioning of data, based, at least, in part, on information about the data or available resources; and employ a modified matrix multiplication technique to identify an optimal manner for parenthesizing associative operations associated with a specified number of partitions of data, wherein the partitions of data have respective matrix sizes, and wherein the optimal manner for parenthesizing associative operations minimizes a number of operations for executing matrix multiplication of the partitions of data.