Abstract:
In one embodiment, a method receives a query for analyzing data in a database. The query includes a first level calculation that is performed before a second level calculation. When an operator associated with the first level calculation is present in the query, the method performs: calculating the first level calculation by removing group by information for a reference characteristic for the first level calculation to determine a first level calculation result and calculating the second level calculation using the first level calculation result using the group by information for the reference characteristic to determine a second level calculation result, wherein the group by in the second level calculation combines groups of rows in a database table of the database that have the same content in their specified columns.
Abstract:
According to an aspect, a system for moving a filter in a query model to ensure query semantics includes a query engine configured to obtain a query model for a query to be executed on a database. The query engine includes a query optimizer configured to instantiate the query model by merging the query with the query model. The query optimizer includes a filter mover configured to move a filter to a point within the instantiated query model such that semantics for the query within the instantiated query model is ensured.