A modern DBMS would rewrite the second query such that the
view definition is substituted for the Keywords table in the FROM
clause. Then, the optimizer can push the WHERE clause in the query
down so that it is applied to the Documents table before the COUNT
is computed, substantially reducing computation. If the documents
are spread across multiple nodes, then this filter can be applied on
each node before documents belonging to the same site are grouped
together, generating much less network I/O.