Scrivio Interview library
ScenarioIntermediate5 min read · updated 13 November 2026

A sales dashboard used by 2,000 employees runs eight queries against a cloud warehouse on every page load and auto-refreshes each minute. Warehouse spend for this one dashboard reached 40,000 dollars a month, and the underlying data only changes hourly.

How would you cut the cost without making the dashboard worse?

The cost comes from repeating full queries over large fact tables for every viewer every minute, although the data changes only hourly. Precompute the dashboard's aggregates hourly into small summary tables or materialized views and point the dashboard at them, align or turn off auto-refresh so the warehouse result cache can help, and serve the summaries from a BI cache or a small serving store with filters limited to what they support. Then track cost per dashboard and per query pattern so the next expensive dashboard is found from data, not from the invoice.

Background to this question

Cloud warehouses make it easy to point a dashboard at raw data and let it run, and the bill only shows up later. Forty thousand dollars a month for one dashboard is a common kind of surprise, and the question of how to cut it without users noticing is a practical test of understanding how warehouses charge and what work is actually needed. In this answer, we will find where the money goes with some arithmetic, precompute aggregates, fix the refresh behaviour and caching, add a serving layer, measure cost per dashboard, and handle the users who need drill-down to raw rows.

1Where the Money Goes

Warehouses charge for compute time or for bytes scanned. Each page load runs eight queries, each probably scanning a large fact table of sales over months, joining dimensions, and aggregating. With auto-refresh every minute, a viewer who leaves the dashboard open in a browser tab for an eight-hour day triggers 8 x 60 x 8 = 3,840 queries. If 300 of the 2,000 employees keep it open, that is over a million queries a day. Most of them compute exactly the same answer as the query before, because the underlying data changes once an hour.

So the dashboard asks the warehouse to redo hours of identical work. The fix is not to make each query cheaper but to stop recomputing what has not changed.

Queries per day before and after
SetupQueries per dayData scanned per query
8 raw queries, refresh every minute, 300 open tabsabout 1,150,000large fact tables
Same, refresh aligned to hourly loadabout 19,000 plus page loadslarge fact tables
Summary tables refreshed hourly8 builds per hour plus page loadssmall summary tables

2Precompute the Aggregates Hourly

The dashboard shows sales by region, product line, rep and day, plus a few totals. Those numbers can be computed once per hour, right after the data load, into small summary tables or materialized views. A summary of sales by day, region, product line and rep might have a few hundred thousand rows instead of hundreds of millions. The dashboard queries then read the summary and return in under a second for a tiny fraction of the cost.

The build can be a scheduled job, a dbt model run after the hourly load, or a materialized view where the warehouse refreshes it automatically. Either way the expensive scan happens once per hour, not once per viewer per minute.

SQL
CREATE OR REPLACE TABLE mart.sales_daily_summary AS
SELECT order_date, region, product_line, rep_id,
sum(amount) AS revenue, count(*) AS orders
FROM fact_sales
WHERE order_date >= dateadd(month, -24, current_date)
GROUP BY 1, 2, 3, 4; -- run once after each hourly load
-- dashboard tile
SELECT region, sum(revenue) FROM mart.sales_daily_summary
WHERE order_date >= '2026-11-01' GROUP BY region; -- reads thousands of rows, not millions

3Fix Refresh and Use the Result Cache

Auto-refresh every minute makes no sense for data that changes hourly. We turn it off, or align it with the load schedule so the dashboard refreshes shortly after each hourly load. Warehouses also keep a result cache: Snowflake and BigQuery, for example, return a previous result without compute if the same query runs again and the underlying tables have not changed, typically within 24 hours. That cache only helps when the query text and the data are identical, so dashboards should generate stable query text, without the current timestamp in the SQL, and the data should change only when the load runs. With hourly summary tables and stable queries, most page loads become cache hits.

4A Serving Cache for the Summary Data

For 2,000 users, an extra layer can remove the warehouse from the page load entirely. Most BI tools can cache query results or extracts and refresh them on a schedule; alternatively, the summary tables can be copied hourly into a small serving store, such as PostgreSQL or a real-time OLAP engine, that the dashboard queries cheaply. Either way, filters on the dashboard should be limited to dimensions the summaries contain. A filter on a field that only exists in the raw table would silently send queries back to the expensive path.

Step throughDashboard serving path
  1. 2,000 users open the dashboardno per-minute auto-refresh
  2. BI cache or serving storesummary data, refreshed hourly
  3. Summary tables in the warehousebuilt once after each load
  4. Raw fact tablesscanned once per hour, not per viewer

4 layers, from the top down. Step through them one at a time.

5Track Cost per Dashboard and Query Pattern

This dashboard was found from the invoice, which is the slowest way. Warehouses expose query history with compute time or bytes per query, and BI tools can tag queries with the dashboard and tile that issued them, for example through query tags or comments. A weekly report of cost per dashboard and per normalised query pattern shows the top spenders and how they change. With an owner for each dashboard and a budget alert, the next expensive dashboard is spotted in a week, not after a month of spend.

6Follow-up questions

How would you handle a few users who need drill-down to raw rows?

Keep the main dashboard on summaries and add an explicit drill-down action that opens a detail view and runs an on-demand query against the raw tables, filtered by the selection the user clicked and limited in rows and date range. It runs only when someone asks for it, a few times a day rather than every minute, and can use a separate, smaller compute cluster so it does not affect others. Access to raw rows can also be restricted to the roles that need it.

Will users notice the change?

If anything, they notice the dashboard got faster. Numbers are as fresh as before, because the data only changed hourly anyway; the page now shows when the data was last loaded, which also avoids questions about stale numbers.

Is a materialized view better than a scheduled table build?

It depends on the warehouse. Materialized views refresh automatically and the optimiser may use them for matching queries, but they have restrictions on joins and functions and their own refresh cost. A scheduled build with dbt is more flexible and easier to test. Either works for this case.

7Conclusion

In this answer, we traced the 40,000 dollars to over a million repeated queries a day over large fact tables for data that changes hourly. We precomputed hourly summary tables or materialized views, turned off or aligned auto-refresh so the result cache works, added a BI cache or small serving store with filters limited to what summaries support, and tracked cost per dashboard and query pattern. Users who need raw rows get an explicit, limited drill-down query.

What to say in the interviewAbout 80 seconds aloud

Open with

The cost comes from repetition. Eight queries per page load over large fact tables, refreshed every minute by however many people leave the dashboard open, is easily a million queries a day, and almost all of them compute the same answer because the data only changes once an hour.

Then, if they want more

So first, I would precompute the dashboard's aggregates once after each hourly load into small summary tables or materialized views, for example sales by day, region, product line and rep, and point every tile at those.

Second, I would turn off the per-minute auto-refresh or align it with the load schedule, and make the generated SQL stable so the warehouse result cache can answer repeated queries without compute; the cache only helps when the query and the data are unchanged.

Third, for 2,000 users I would add a BI extract cache or copy the summaries into a small serving store, and restrict dashboard filters to dimensions the summaries contain, so nobody accidentally goes back to raw tables.

Finally, I would tag queries by dashboard and track cost per dashboard and query pattern, so we find the next one from data instead of the invoice. Users who need raw rows get an explicit drill-down that runs on demand with limits.

About this answer

Last updated
13 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the official documentation for the version you use. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "How would you cut the cost without making the dashboard worse?": https://scrivio-interview-library.netlify.app/architecture/storage-and-pipelines/ffbe1c4e6f/