Handle materialised views more efficiently, by not running queries
for every view. Run make style while we're at it.