AccelerUpDocs
Data warehouse/Cost monitor

Warehouse cost monitor

What the queries cost, and which ones are responsible.

Data Warehouse → Cost Monitor shows what AccelerUp's own querying costs the warehouse.

What is tracked

Queries per periodTotal, and by source
DurationTotal and per query
Rows scannedWhere the warehouse reports it
By sourceAlert, dashboard, scheduled query, SQL Lab, report

The usual findings

A dashboard refreshing too often. Twelve tiles at a one-minute refresh is 17,280 queries a day, for data that changes hourly.

An alert running more often than its data changes. A rule evaluating every five minutes against a table loaded nightly is 287 wasted executions a day. Fix it with a run window, which stops the query being run at all outside the window.

One expensive query. Usually a missing WHERE on a partition column. It is easy to spot here and invisible everywhere else.

Reducing it

DoInstead of
A run window matching the data's load scheduleEvaluating around the clock
An interval matching how fast the data changesA default five minutes
Aggregating in the queryReturning rows AccelerUp then aggregates
One query with several conditionsSeveral rules holding copies of the same SQL

The last is worth emphasising: per-column conditions exist precisely so that alerting on four columns runs the query once. See SQL alerts.

Where this behaviour lives: frontend/src/app/dwh/cost/. If the code and this page disagree, the code is right — please fix the page.

Part of Data warehouseQuerying the warehouse, and alerting on what the query returns.