jargon

Comparison

Bytes scannedvsQuery cost

Bytes scanned

the query returned four rows and the console says it read two point one terabytes.

How much data a query actually read from storage, which on most modern warehouses is what you are billed for. It is the number to optimise rather than runtime, because a fast query on a large scan is still expensive and caching makes runtime a liar. It also makes the effect of layout legible: the same query on the same data can differ by three orders of magnitude in bytes scanned depending on partitioning and column selection.

Full entry →

Query cost

one dashboard refreshing every five minutes turned out to be a third of the monthly warehouse bill.

What a query costs in money, whether billed per byte scanned or per second of warehouse time. Making it visible per query, per user and per dashboard is the intervention that changes behaviour, because the expensive things are almost never the ones people suspect. The usual finding is that a handful of scheduled refreshes dominate, and the fix is a schedule change rather than any SQL at all.

Full entry →

Related comparisons