How a warehouse bills you
A cloud warehouse bills for the data a query reads, or for the machine time it uses.
A query can be correct and still cost too much. A cloud warehouse is a database built for large reports. Vendors bill for it in two main ways:
| Billing model | You pay for | Where you see it |
|---|---|---|
| Bytes scanned | The data the query reads | BigQuery on-demand pricing (you pay per query), per TiB scanned |
| Compute time | The machines you run, by the second or hour | Snowflake compute (explained in the compute section); BigQuery or Redshift capacity |
Prices and rules change. Check the current docs of your product before you quote any number.
The size we assume
In this chapter, imagine the shop's orders table is 2 TiB. This is an assumption. It gives the cost numbers a scale.
A TiB (tebibyte) is 1,024 GiB. It is about 1.1 TB. BigQuery bills per TiB, so we use TiB and GiB everywhere.
Our example rate is $5 per TiB. It is not a real price.
From Storage Layers & File Formats: a column store reads only the columns you name. Min and max values in the Parquet footer let the engine skip row groups. Every cost idea here builds on those two facts.
