Database SQL polling views and caches