A method comprising: receiving, at a database system, a query comprising a multi-way join comprising a plurality of join operations, each join operation of said plurality of join operations involving a respective first join key of a respective first table and a respective second join key of a respective second table; wherein the plurality of join operations includes a first join operation, a second join operation, and a third join operation; for the first join operation: partitioning the respective first table of the first join operation into a plurality of partitions based on said respective first join key of said first join operation; generating a first partition map that maps values contained in a respective first join key of the second join operation to said plurality of partitions, said respective first join key of the second join operation being a column of the respective first table of said first join operation; partitioning the respective second table of the first join operation into said plurality of partitions based on said respective second join key of said first join operation; generating a second partition map that maps values contained in a respective first join key of the third join operation to said plurality of partitions, said respective first join key of the third join operation being a column of the respective second table of said first join operation; partitioning the respective second table of said second join operation based on the first partition map and the respective second join key of said second join operation; partitioning the respective second table of the third join operation based on the second partition map and the respective second join key of said third join operation; and determining, based at least on the plurality of partitions, results for the multi-way join, wherein, if two tables are connected by a join criterion, only rows that were assigned to the same partitions are compared to determine whether the rows satisfy the join criterion. receiving, at a database system, a query comprising a multi-way join comprising a plurality of join operations, each join operation of said plurality of join operations involving a respective first join key of a respective first table and a respective second join key of a respective second table; wherein the plurality of join operations includes a first join operation, a second join operation, and a third join operation; for the first join operation: partitioning the respective first table of the first join operation into a plurality of partitions based on said respective first join key of said first join operation; generating a first partition map that maps values contained in a respective first join key of the second join operation to said plurality of partitions, said respective first join key of the second join operation being a column of the respective first table of said first join operation; partitioning the respective second table of the first join operation into said plurality of partitions based on said respective second join key of said first join operation; generating a second partition map that maps values contained in a respective first join key of the third join operation to said plurality of partitions, said respective first join key of the third join operation being a column of the respective second table of said first join operation; partitioning the respective first table of the first join operation into a plurality of partitions based on said respective first join key of said first join operation; generating a first partition map that maps values contained in a respective first join key of the second join operation to said plurality of partitions, said respective first join key of the second join operation being a column of the respective first table of said first join operation; partitioning the respective second table of the first join operation into said plurality of partitions based on said respective second join key of said first join operation; generating a second partition map that maps values contained in a respective first join key of the third join operation to said plurality of partitions, said respective first join key of the third join operation being a column of the respective second table of said first join operation; partitioning the respective second table of said second join operation based on the first partition map and the respective second join key of said second join operation; partitioning the respective second table of the third join operation based on the second partition map and the respective second join key of said third join operation; and determining, based at least on the plurality of partitions, results for the multi-way join, wherein, if two tables are connected by a join criterion, only rows that were assigned to the same partitions are compared to determine whether the rows satisfy the join criterion.