Reduce dashboard latency at the right grain
Twelve charts compute hourly totals from the same raw telemetry. The team proposes adding capacity. What should you measure first?
Reduce dashboard latency at the right grain
Decompose dashboard time into queueing, scan and execution, network delivery and rendering. Test the same query and filter before and after each change. A city-hour summary accelerates city-hour charts but cannot answer a later request for an individual trip.
In the recording
Precompute trip duration and aggregate by city and hour to avoid repeating the same work in every dashboard chart.
Work through the decision
Twelve charts compute hourly totals from the same raw telemetry. The team proposes adding capacity. What should you measure first?
Check your reasoning
Read the job timeline and query plan. Compare bytes read, filter selectivity, shuffle and queue time. If several charts repeatedly aggregate identical facts, precompute the appropriate grouping and reconcile it to a small raw interval before switching readers.
Decisions and tradeoffs
- Materialized aggregate
- Reuse a maintained aggregation when queries repeatedly compute the same supported grouping. Check freshness and whether the optimizer uses it.
- Partition filter
- Bound time-partitioned reads with a selective predicate on the partition column and verify bytes scanned.
- BI Engine acceleration
- Evaluate an in-memory acceleration reservation for eligible interactive BI queries. Measure the effect on representative requests.
- Column masking
- Expose an approved masked value to the reader’s identity while preserving protected originals and auditing access.
Test the grain with a small query
In a GoogleSQL query editor, use this self-contained sample to check the day-and-city grain before applying the same logic to a large table.
WITH trips AS (
SELECT DATE '2026-03-01' AS day, 'Lyon' AS city, 8 AS minutes UNION ALL
SELECT DATE '2026-03-01', 'Lyon', 12 UNION ALL
SELECT DATE '2026-03-01', 'Lille', 4
)
SELECT day, city, COUNT(*) AS trips, SUM(minutes) AS minutes
FROM trips
GROUP BY day, city
ORDER BY city;Expect one Lille trip totaling 4 minutes and two Lyon trips totaling 20 minutes. If a reader later asks for the longest single trip, the count and sum alone cannot recover that value. Include the required measure at the chosen grain or route that request to appropriate detail.
Practice the guide skills
- Check which identity and connection the dashboard uses.
- Choose a reusable grain and reconcile an example total.
- Benchmark materialized views and BI Engine on representative queries.
- Inspect plan stages, partitions and queue time for a slow chart.
- Compare authorized reader results after masking sensitive columns.
Official objectives for this lesson
Related lesson · Turn a business question into a bounded analytical query
Follow the result into Power BI · Separate visual rendering time from query time
Reduce dashboard latency at the right grain quiz
Answer 3 questions. Check each answer for an explanation.