Andrew Fribush

← All posts

Why we deleted the vector database

· February 8, 2027 · 7 min read

We deleted the Vector Search terraform module and now serve the same nearest-neighbor lookup with BigQuery's native VECTOR_SEARCH, over a table in the warehouse every deployment already runs. The platform this was for runs one deployment per customer, inside each customer's own Google Cloud project, so anything with a fixed monthly price lands on every one of those bills. The smallest Vertex AI Vector Search deployment that holds 250,000 embeddings of 768 dimensions is one e2-standard-2 node at $0.0938084 an hour, which is $68.48 a month, and Google recommends two replicas, which makes it $137. The node is billed for capacity. A customer who runs no searches in a month pays $137, and so does one who runs 10,000 a day.

That fixed price outweighed everything else we compared. At the query ceiling we planned for, the warehouse search costs about $125 a month with an IVF index, close to the node's $137. At the load an agent actually generates it costs between $0 and about $7. Without the index the same ceiling costs about $2,600 a month, so the index is mandatory.

This covers Google Cloud list prices retrieved on 11 June 2026 for us-central1, and the arithmetic behind each monthly figure.

What each option costs per customer

The ceiling is 10,000 queries a day, 300,000 a month, which was the stated upper bound for one customer's agent. Realistic agent load is about 500 a day. Every figure is per customer per month.

OptionFixedAt 10,000 queries a dayAt about 500 queries a day
Vertex AI Vector Search, 2 replicas$137$137$137
Vertex AI Search, Standard$0about $435about $7
BigQuery VECTOR_SEARCH, IVF index$0about $125about $0 to $7
BigQuery VECTOR_SEARCH, brute force$0about $2,600not costed
fig. 2.40.1 · one customer’s bill a month: the vector-search node is $137 at any load; the indexed warehouse search is $0 to about $7 at real agent load and about $125 at the 10,000-a-day ceiling.
ONE LINE, ONE OPTION: ONE CUSTOMER’S BILL A MONTH · LOG AXES · $0 ON THE BOTTOM RAIL$0.10$1$10$100$1K$10K$0REAL LOAD≈500/DAYCEILING10,000/DAY$0 TO ≈$7BQ BRUTE FORCE≈$2,600VERTEX AI SEARCH$435VECTOR SEARCH$137BQ IVF INDEX≈$125ONE REPLICA$68101001K10KQUERIES A DAY, ONE CUSTOMER

Each customer runs in its own Google Cloud project, so every free tier applies per customer: 10,000 Vertex AI Search queries and 1 TiB of BigQuery scanning a month.

source: Retrieval decision doc vector_search_decision.md (2026-06-11), cost table and BigQuery math lines 22-37, quoting Google Cloud list prices for us-central1 retrieved 2026-06-11 (Vertex AI, Vertex AI Search and BigQuery pricing pages); curves are that arithmetic at every load, 30-day month · vectorDbCost.data.ts

Vector Search's $137 also isn't the whole bill. A full batch rebuild of the index is processed at $3.00 a GiB, about $2.30 a rebuild at this size, and serving it privately needs a Private Service Connect endpoint and the VPC plumbing behind it. Vertex AI Search, the managed search product, charges $1.50 per thousand queries on the Standard tier after the first 10,000 each month. At the ceiling that's 290,000 billed queries, $435. The Enterprise tier at $4.00 per thousand is $1,160. It's built for document search and generated answers: it wants raw documents and makes its own embeddings. We already had embeddings from a batch job and an agent that writes its own answers. Its edge over the other three options is hybrid keyword and semantic search, and the agent already does keyword work in SQL, including BigQuery's SEARCH().

Each customer that signs adds $137 a month before its first query, so ten customers carry $1,370 a month of floor, and that holds whether two of them are heavy users or none are. The two BigQuery rows add nothing for a customer that doesn't search, because the table is billed as storage: 1.4 GiB, inside the first 10 GiB that BigQuery stores free.

The index is mandatory

BigQuery's on-demand pricing is $6.25 per TiB scanned, with the first TiB each month free. Embeddings are stored as ARRAY<FLOAT64>, eight bytes a dimension, because BigQuery has no 32-bit float type. So 250,000 rows times 768 dimensions times 8 bytes is 1.43 GiB. A brute-force search reads all of it for every query, and 300,000 queries a month reads about 419 TiB, which is about $2,600.

An IVF index groups the vectors into lists and searches only some of them. BigQuery's docs say an indexed search is "charged for the amount of bytes scanned in the base table, the index, and the search query." The default fraction_lists_to_search is about 5 percent, and 5 percent of the base table is about 73 MiB a query. The ceiling's 300,000 queries a month scan about 21 TiB, which is about $125 once the free first TiB comes off. At 500 queries a day that's 15,000 queries and about 1 TiB scanned, and the free TiB covers nearly all of it.

The 768 dimensions are a choice. gemini-embedding-001 produces 3,072 by default and is trained so it can be truncated, and Google states no quality loss down to 768. Every byte figure above is four times larger at 3,072, and so is every dollar figure that comes from bytes, which is another reason the dimension is pinned to 768 in configuration.

This is a reduction of the query the tools API sends (the real one interpolates an app-built float literal and a validated filter id, and never the user's text), with the index DDL below it:

SQL
SELECT base.call_id, base.filter_name, base.quote_text, distanceFROM VECTOR_SEARCH(  (SELECT call_id, filter_name, quote_text, embedding   FROM quote_embeddings   WHERE filter_name = @filter_name),  'embedding',  (SELECT @query_vector AS embedding),  top_k => 10, distance_type => 'COSINE')ORDER BY distance;-- not created by the terraform yet; kept as a comment in the warehouse moduleCREATE VECTOR INDEX IF NOT EXISTS quote_embeddings_ivfON quote_embeddings(embedding)STORING (filter_name)OPTIONS (index_type = 'IVF', distance_type = 'COSINE');

BigQuery only populates an IVF index once a table passes 10 MB and searches smaller tables by brute force, and the dev deployment holds 200 quote embeddings. The decision doc sets the trigger for changing course: if a customer's sustained bytes billed for quote search passes about $70 a month, which is roughly the cost of one e2-standard-2, the Vector Search module goes back in for that customer from git history.

The node side of the comparison rests on Google's own figure. Vector Search's pricing page gives an example of 2 million vectors at 128 dimensions serving 100 queries a second on one e2-standard-2 for $68 a month, and 250,000 vectors at 768 dimensions fits the same single node. Expected growth is about 25,000 calls a month per customer, which comes to 1 to 2 million vectors after a year. That's 6 to 12 GiB in BigQuery and still one Vector Search node.

The warehouse answers inside the tool call's tolerance

The tolerance for the agent's search tool call is 1 to 2 seconds. An indexed VECTOR_SEARCH at 250,000 rows usually returns in under a second to a few seconds, so the expected range is inside it for most calls. Vector Search's serving nodes answer in under 50 ms, and the decision doc calls this "exactly the case where Vector Search's <50 ms serving nodes are wasted money."

Staying in SQL kept three things the node would have cost. Metadata filters are a plain WHERE in the base-table subquery (with STORING columns on the index), where Vector Search needs filter values baked in at upsert time with limited types. A row is searchable as soon as the ETL loads it, against an operator-run gcloud batch update for Vector Search. And the local development path is DuckDB computing cosine distance over the same table shape, so both backends rank the same rows identically and the tests run with no cloud credentials. Vector Search would also have meant a second client stack with its own SDK, private endpoint DNS and IAM, and nothing to run locally.

What the deletion bought

The case against the node is $68 to $137 a month, a figure the decision doc itself doesn't call expensive, times every customer, 24 hours a day, plus a private endpoint, manual index deploys and $3.00-a-GiB batch updates, for a lookup that SQL against tables we already operate handles at this scale. The module came out of the shared modules and out of every customer's configuration, and the per-customer cost model lost a fixed line. The first customer whose quote search bills more than about $70 a month gets the module back.

fig. 2.40.2 · the fleet bill: every customer adds vector search’s $137 floor whether it searches or not, while the indexed warehouse search adds almost nothing at real load.
QUERIES A DAY, EACH:10100≈500 REAL1,0005,00010,000 MAXONE LINE, ONE OPTION: THE FLEET’S BILL A MONTH; EACH CUSTOMER HAS ITS OWN PROJECT ANDFREE TIER$0$5K$10K10 CUSTOMERS$1,370$1,247$75$2.77VECTOR SEARCHBQ BRUTE FORCEVERTEX AI SEARCHBQ IVF INDEX020406080100CUSTOMERS, ONE PROJECT EACH · DRAG ALONG THE PLOT TO READ ANY FLEET

One customer: 250,000 embeddings of 768 dimensions, a 30-day month. Vector Search is two e2-standard-2 replicas; Vertex AI Search is the Standard tier.

source: Retrieval decision doc vector_search_decision.md (2026-06-11) lines 22-37: $137 a month for two e2-standard-2 replicas; $1.50 per 1,000 queries after 10,000 free; 1.43 GiB brute force and about 73 MiB IVF scanned per query at $6.25 per TiB after 1 TiB free; every tier per customer project, 30-day month · vectorDbCost.data.ts

Andrew Fribush, software and computer engineer in Austin. I build consequential systems where software meets institutions: finance, healthcare, commerce, government data, and the mechanisms that govern AI agents. Taking new engagements: hello@andrewfribush.com.

I write when a system teaches me something. Get new posts by email — no tracking, one-click unsubscribe.