Patent ID: 7415454

Claim:
A computer-implemented method for improving a performance of an allocation by query optimization, comprising: receiving a first query that specifies: a calculation target expression that specifies a set of calculation target cells that consists of all cells in a multidimensional dataset (MDDS) that are associated with a member of each non-calculation dimension of the MDDS that is in a set of members and is associated with a calculation target member in a calculation dimension of the MDDS, wherein the set of calculation target cells is dividable into: a set of non-empty calculation target cells that consists of each non-empty cell in the set of calculation target cells; and a set of empty calculation target cells that consists of each empty cell in the set of calculation target cells; a calculation expression that specifies that values in the set of calculation target cells are to be calculated from values in a set of calculation source cells that consists of all cells in the MDDS that are associated with a member of each non-calculation dimension of the MDDS that is in the set of members and is associated with a calculation source member in the calculation dimension of the MDDS; and a first selection expression that specifies a selected set of cells in the MDDS by specifying that the selected set of cells is derivable by finding non-empty cells in the set of calculation target cells; in response to receiving the first query, symbolically analyzing the calculation expression to identify the calculation source member; after symbolically analyzing the calculation expression, using the first query and the identified calculation source member to generate a second query that specifies: the calculation target expression; the calculation expression; and a second selection expression that specifies the selected set of cells in the MDDS by specifying that the set of non-empty calculation target cells is derivable by computing a cross join of: a non-empty cross join of the members in the set of members; and the calculation target member; executing the second query to obtain values in the selected set of cells by: computing the non-empty cross join of the members in the set of members, thereby computing a first set of tuples that identify cells in the MDDS; wherein each tuple in the first set of tuples specifies a member in the set of members of each of the non-calculation dimensions; and wherein no cell indicated by a tuple in the first set of tuples is empty; computing the cross join of the first set of tuples and the calculation target member, thereby computing a second set of tuples that identify all cells in the set of non-empty calculation target cells; using the calculation expression to calculate values in the set of non-empty calculation target cells, thereby obtaining the values in the selected set of cells; and after obtaining the values in the selected set of cells, returning the values in the selected set of cells.