1. A method for determining orders for evaluating a set of formulas defined by a queries, the method comprising the steps of: examining a query: wherein said query evaluates to a relation; wherein the query defines an array and a set of formulas that reference the array; wherein the array has one or more dimensions that correspond to columns of the relation; wherein a subset of formulas of the set of formulas require cells corresponding to a range of values of said dimension; grouping, based one or more criteria, the set of formulas into groups of formulas, wherein the groups are associated with an order, and wherein said one or more criteria include that, for each group of said groups of formulas, evaluation of any formula in said each group does not depend: on another formula in said each group, and does not depend on another formula in a group higher in said order than said each group; and evaluating in said order each group of said groups of formula.