1. A computer implemented method, comprising: transforming a base query to generate a transformed query; wherein the base query includes a union between each base branch of a plurality of base branches; wherein two or more base branches of said plurality of base branches joins a set of tables; wherein the sets of tables of two or more base branches of the plurality of base branches includes a common table set shared by all the sets of tables, said common table set including common table; and wherein the step of transforming the base query includes replacing the plurality of base branches with a first group branch that joins the common table and an inline view, the inline view comprising a union between a plurality of respective branches, wherein the plurality of respective branches includes, for each base branch of said plurality of base branches, a FROM list that: references the respective set of tables that are not in the common table set, and does not reference the common table.