Optimizations

This branch, to be merged after #116, adds cached columns `last_event_at` and `last_error_log_at` to speed up various views.