There is a set of queries which can be answered entirely from statistics stored in metastore.
Examples of such queries are count(*), count(a), max(a), min(b) etc. Hive already collects
these basic statistics for query planning purposes. These same statistics can be used to
answer queries also.
Optimizer looks at query plan to determine if it can answer query using statistics
and than change the plan to answer query entirely using statistics stored in metastore.