1. A computer-implemented method, comprising determining to defer a XML rewrite of a certain query until after performing a view merge of said certain query, wherein said certain query references a view; in response to determining to defer said XML rewrite of a certain query, performing a view merge of said certain query; and subsequent to performing said view merge of said certain query, performing said XML rewrite of said certain query.