For faster retrieval it makes sense to store some tables/query results as in-memory caches rather than query the DB constantly.