Make sure we account for materialized views where needed