Data Engineering Reference/Deep Cuts (Platform)

Warehouse Query Engines

How BigQuery, Snowflake, and Databricks SQL execute queries — separation of storage/compute, columnar scan, pruning, and why dbt runs fast or slow.

5/5Overview: 30m

Separation of storage and compute

Modern warehouses decouple:

  • Storage — columnar files on object store (S3, GCS, Colossus)
  • Compute — elastic clusters that spin up per query

You pay for storage continuously; compute only when queries run (ideally).

BigQuery (Dremel lineage)

  • Colossus — distributed storage
  • Dremel — execution engine with columnar scan and tree architecture
  • Slots — compute units; autoscale or reservation

Partitioning + clustering prune bytes scanned — billed on data read.

Snowflake

Three layers:

  1. Database storage — micro-partitions (columnar, compressed)
  2. Compute — virtual warehouses (independent scale)
  3. Cloud services — metadata, optimizer, auth

Multi-cluster warehouses — auto-scale compute for concurrency.

Databricks SQL / Photon

  • Delta Lake on object storage
  • Photon — vectorized C++ engine for SQL
  • SQL warehouses — serverless or provisioned

Unity Catalog unifies governance across Spark and SQL.

Why dbt models are slow

CauseFix
Full table scanIncremental + partition filter
No clusteringCluster on filter columns
Cartesian joinFix grain in intermediate
Tiny warehouseRight-size or auto-scale
JSON shreddingPre-parse in silver Spark

Link to Databases (columnar/search) for file format theory — here: query execution economics.

Interview answer template

"dbt mart scans 10TB because where order_date is missing — partition prune fails. Add partition column, switch to incremental merge, cluster on customer_id for join queries, and use a larger warehouse only for the mart build — not interactive default."

Further Reading

Hands-On Tasks (Optional)

Pipeline design drills and whiteboard exercises — DAG sketches, partition plans, backfill strategies. Assumes Databases and SQL fundamentals are in place.

  • Debug a slow dbt model

    Mart query scans 10TB, runs 45 min. List 5 checks: clustering/partitioning, join order, late binding, warehouse size, incremental strategy.

    15m