some db optimizations for _is_viewable