1. A method of performing a multi-way join of a plurality of database relations, comprising: executing a plurality of pipelined two-way joins with said relations, each said two-way join comprising a first phase and a second phase; in which said first phase of each said two-way join comprises: materializing from a non-volatile memory device any missing attributes in input relations that are required in a joining criterion specific to said two-way join and have not been materialized; and joining said input relations according to said criterion; and in which said second phase of each said two-way join comprises: materializing from said non-volatile memory device any additional missing attributes in said input relations as assigned by an optimization process executed prior to commencing said multi-way join, in which the attributes in the relations are assigned to be materialized at one of the first phase and second phase of the two-way join based on whether the attributes are required for the recipient of the two-way join's result and based on whether the current two-way join requires the attributes, and in which the missing attributes comprise any attributes that are required for the result of the two-way join and have not been materialized.