1. A method comprising: receiving a query; creating a normalized query tree (NQT) corresponding to the query; receiving a control statement that represents at least a portion of a desired execution plan associated with the query; creating a control query shape (CQS) corresponding to the desired execution plan; and producing an execution plan that conforms to the desired plan to the extent that the produced plan preserves the semantics of the query, wherein said producing comprises constructing a transformed shape with one or more join nodes, wherein each join node has children corresponding to left and right child table subsets of the CQS only if each said join node preserves the semantics of the query.