With analytical views enabled, Arcadia Engine evaluates each incoming query against existing analytical views in order to improve performance.
Consider the following situations for matching queries to existing analytical views. For the purpose of this discussion, we care considering queries and subqueries that access a single table. We discuss joins and unions separately.
If the analytical view is a superset of the data that the query (or subquery) requires, Arcadia Engine routes the query to that analytical view. It also 'trims' the execution in following cases:
When the analytical view has columns: (a, b), and the query has: (a + b).
When the analytical view has a predicate: (a=10), and the query has: (a=10 and b > 13).
When the analytical view groups on: (year, month, day), and the query has groups on: (year).
When the analytical view data is not ordered, and the query requires data to be ordered on ‘year’.
When the analytical view does not apply a limit, and the query has a (‘limit 10’) clause.
When an analytical view contains some but not all of the data that the query or subquery requires, Arcadia Engine does not use it. The query is not routed to that analytical view.
When an analytical view contains some but not all of the data that the query or subquery requires, plus additional information that it does not require, Arcadia Engine does not use it. The query is not routed to that analytical view.