Precalculation computes values in advance so they can be stored and retrieved rather than recomputed for each query. In a CQRS view, deciding what to precompute is part of designing a schema that serves queries efficiently without making event-handler updates inefficient. section 13.3.2
Use precomputation when query efficiency matters, weighing its benefits against the work of keeping the view updated.
- For large datasets or high query volumes, precomputation and related schema optimizations can help meet query SLOs and control costs. section 13.3
- For small datasets queried infrequently, a normalized relational schema with joins may be simpler and adequate. section 13.3
Restaurant proximity query
A view schema can store a restaurant’s latitude and longitude to support a proximity filter, even though those values are not returned in the query result. section 13.3.2


