About

This project is pretty, pretty, pretty bonkers.

Curb Your Enthusiasm is comedy gold, the hit HBO show starring Larry David playing himself, the co-creator of Seinfeld. In almost every episode, the iconic Jewish curmudgeon talks himself into a situation that ends up costing him money. So I wondered, if we tallied up every one of those mishaps and set them against Larry David's real-life net worth, what would his personality actually cost him?

The mission

Larry's mishaps are the hook. The point is the dbt semantic layer.

Define a metric once. Use it everywhere, in dashboards, reports and AI answers. Always the same, always traceable to the warehouse.

Once every metric is defined in one place and wired to the dashboard, the page practically builds itself, and every number on it traces back to the warehouse, with no hand-written queries behind any chart.

That matters most with AI. An AI that writes its own SQL can be confidently wrong. An AI that asks a governed semantic layer gives answers that match the agreed definitions. In this project, every metric was checked by hand against the warehouse and the source Sheet before anything was built on it.

How it's built

  1. Investigative workEvery episode of all 12 seasons, checked against Wikipedia, the Curb fan wiki and IMDb plot synopses, and re-watched to validate the situations those online sources describe. Each money-losing moment became a row, and each unstated cost was researched and priced.
  2. Google SheetThe source of truth, with one row per mishap, each marked keep, drop or unsure by a human reviewer, with its price, how it was priced, a confidence level and a source.
  3. BigQueryThe warehouse reads the Sheet live as an external table. No exports or copy-paste. An edit in the Sheet reaches the warehouse on the next build.
  4. dbt stagingEvery column is cleaned, renamed and cast to its proper type. A bad cell fails the build with the value in the error instead of quietly becoming a blank, and tests check the data before anything is built on it.
  5. dbt star schemaOne fact table of mishaps, joined to dimensions for episodes, net worth by year and the calendar. This is where the rules live, like which rows count and which price to use.
  6. Semantic layerEvery number on this site is defined once, by name, in YAML, like Total Mishap Loss, Median Mishap Cost, Net Worth After Mishaps and the rest. Change a definition there and it changes everywhere.
  7. MetricFlowdbt's metrics engine turns those definitions into SQL. Each chart is a saved query (metrics by name, sliced by season, year or loss kind), exported from the production warehouse to the files this site is built from.
  8. ValidationBefore any chart was built, every metric was checked by hand, comparing MetricFlow's answers with the warehouse and with the source Sheet's own year-by-year totals, down to the dollar. dbt tests catch duplicate mishaps and missing costs on every build, and each release to production must match development before the site reads it.
  9. AI-assisted dashboardThe site was built with Claude. AI is non-deterministic. Ask twice and you can get two different pages. The numbers are not. The page only reads values the semantic layer produced, and only sorts, picks and formats them. It never writes its own query or does its own math, so it can't invent its own version of a figure.

One metric, everywhere

Below is Total Mishap Loss exactly as it's defined in the semantic layer. It's a few lines of YAML, and the only place the metric exists. It produces $262,199,688, the same figure in the headline on Mishap Costs by Season and in the first answer on We've Got Answers. Sliced by season or loss kind, the same definition gives every filtered total.

- name: total_mishap_loss
  label: Total Mishap Loss
  description: >
    Every kept mishap, realized + hypothetical + catastrophic. Hypothetical losses always
    count; loss_kind is only a slice.
  type: simple
  type_params:
    measure:
      name: mishap_cost
      fill_nulls_with: 0

Data collection

Sources

Episodes and mishaps

Prices

Larry David's net worth

Rich Marafioti

Rich Marafioti is an analytics engineer working in K–12 education, with proficiencies in SQL, dbt, data modeling and BI development.