摘要 |
Methods, computer-readable media, and machines are provided for transforming a query by removing a correlated predicate from a lateral view in an initial query. A query processor may transform the lateral view into a regular view such that a transformed query with the regular view is semantically equivalent to the initial query. The transformed query may support a larger set of access paths, join methods, and join permutations, may qualify for other transformations or optimizations, or may otherwise be executed or optimized differently from the initial query. The lateral view may reference an aggregation function, and the query processor may add a GROUP BY operator to the transformed query to preserve, after the correlated predicate has been pulled out of the lateral view, an interaction that was present between the aggregation function and the correlated predicate when the correlated predicate was in the lateral view.
|