The Real Cost of a Query | Aishwarya Patil

Humanitarians AI Fellow Aishwarya Patil walks through a real BigQuery quota error, the investigation into its cause, the cost math, and the decision to add billing. She also covers a rejected alternative and a second cost, the Anthropic API.

2:16 video3 min readWatch on YouTube

Humanitarians AI Fellow Aishwarya Patil presents something that rarely makes it into a project demo: what it actually costs, in real dollars, to query a very large public dataset, and what happens when that cost appears mid-project. The video follows a genuine error, the investigation that explained it, and the decisions that came afterward.

The error that stopped the project

Nine test runs into the work, the project hit an error saying it had exceeded its quota for free query bytes scanned. The free tier was gone. The video explains that BigQuery gives one terabyte of free query processing a month, and that past that point usage is billed. The error message said, word for word, to upgrade to a paid billing account to continue.

Investigating the real cause

The first assumption was that a wildcard search was the expensive part. Checking the actual job history showed otherwise. An exact match on a single patent scanned about 116 GB. Repeating that exact query processed zero bytes, because the result was fully cached. The real cost was not the style of the query but the table itself: roughly 98 million rows with no clustering on the field being searched, so even a precise lookup had to scan a huge amount of data.

The cost math and the decision

At $6.25 per terabyte, each lookup of that size came to about 70 cents. The video treats that as real money and therefore a real decision. A billing account was set up and linked to the project, and the work continued with a new discipline: reuse cached results instead of re-querying blindly.

A dead end worth reporting

Before spending more, the fellow looked at a cheaper table that seemed promising. It was about a third the size and had fields that looked like a pre-built dependency parser. Checking it directly showed it was last updated in 2017 and did not cover any of the patents the project needed. The video calls this an honest dead end rather than a shortcut, and includes it because ruling out the cheap option is part of the real story.

The second cost: the Anthropic API

Classifying the scope of patent claims protection needed real judgment, not simple rules, so the Anthropic API came into the project. That meant a real key and a real per-token cost that is tiny per call but still real. The description also notes that a real model refusal came up along the way. The video's summary is that money and effort went into two separate fronts, and both times it was because the cheap option was tried first and genuinely did not hold up.

Key takeaways

  • BigQuery's free tier gives one terabyte of query processing a month, and the quota can run out during testing.
  • Check the actual job history rather than guessing which query is expensive.
  • In this case an exact match on one patent scanned about 116 GB, while an identical repeat processed zero bytes because it was cached.
  • A large table with no clustering on the searched field makes even precise lookups costly.
  • At $6.25 per terabyte, the lookups cost about 70 cents each.
  • Reusing cached results is a practical way to avoid paying twice.
  • Try the cheaper alternative first, and be ready to report honestly when it does not work.
  • Language-model API calls add a second cost that is small per call but real.

Try it yourself

Before trusting any dataset's cost, do what the video recommends: check the actual job history, the bytes processed, the caching, and the size of the table you are touching, rather than assuming from how the query reads. Run one lookup, then look at the bytes it scanned before you run the next.

Chapters

  1. 0:00Introduction
  2. 0:23The Real Error
  3. 0:37The Investigation
  4. 1:03The Real Math
  5. 1:20The Honest Dead End
  6. 1:39The Second Investment
  7. 1:59Your Turn: Check Before You Query
  8. 2:12Outro
Full transcript(auto-generated, with timestamps)

Introduction

[0:00]Hi, I'm Aishwarya from the Microsoft team. This video covers something that doesn't usually make it into a demo. What it actually costs in real dollars to query a real massive data set and what happens when that cost shows up mid-project. Nine test runs in, one error. Your project exceeded quota for free query bytes scanned. The free tier was gone. Method, BigQuery gives 1 TB of

The Real Error

[0:25]Free query processing a month. Past that, it's real build usage and the exact error word for word said to upgrade to a paid billing account to continue. The first assumption was

The Investigation

[0:37]Wrong, that a wildcard search was the expensive part. Checking the actual job history told a different story. An exact match on one single patent scanned 116 58 GB. Same result on a repeat of that exact query, zero bytes fully cached. The real cost wasn't the query style. It was the table itself, 100 million rows, no clustering on the field being searched. At $6.25

The Real Math

[1:04]Per terabyte, that's about 70 cents a lookup. Real money, so a real decision. Add a billing account. Set one up, linked it to the project, and kept going with the discipline to reuse cached results instead of re-querying blindly. Before spending more, a cheaper table

The Honest Dead End

[1:21]Looked promising, a third the size with fields that looked like a pre-built dependency parser. Checking it directly, last updated 2017. It didn't cover any of the patents this project actually needed. A real honest dead end, not a shortcut. Classifying a

The Second Investment

[1:39]Claims protection scope needed real judgment, not a rejects. So, the Anthropic API came into a real key, a real per token cost, tiny per call, but real. Real money and effort on two separate fronts, both times because the cheap option was tried first and genuinely didn't hold up. Your turn. Before

Your Turn: Check Before You Query

[2:00]Trusting any data sets cost, check the actual job history, the bytes processed, the caching, the size of the table you're touching, rather than assuming based on how the query reads. The real cost of a query built with Claude for

Outro

[2:14]Humanitarian's AI.

More from Mycroft Financial AI

Humanitarians AI Lyrical Literacy Project