LLMs as Cardinality Estimators: Accurate, But Only If You Don't Call Them Every Time

Cardinality estimation is the heart of the optimizer. A team from Peking University and ByteDance fine-tunes Llama-3 8B to do CardEst, and on workloads like IMDB and STATS the 99th-percentile Q-error drops by up to 74.1% versus the strongest baseline (PRICE) — the accuracy win is real. But end-to-end, it backfires: on JOB-light and ErgastF1 the LLM’s more accurate plans are dragged down by its own inference latency, with total time exceeding even the strongest baseline PRICE. The real engineering contribution isn’t the model — it’s the gate that uses the optimizer’s own cost model as a bouncer: call the LLM only for high-cost sub-queries, leave the rest to the old methods.

May 31, 2026 · 7 min · Kent Yao

When the Index Tuner's Cost Model Lies: Where LLMs See What DTA Can't

A Microsoft team evaluates LLM-driven index tuning on real enterprise customer workloads. On query 22 of Real-R, the SOTA commercial tuner DTA recommends indexes that cause a near-10x regression; on the same query, GPT-5 cuts execution time from 10 seconds to 4. The LLM wins precisely where the what-if cost model is wrong. But that intuition is high-variance, can’t be bolted into the existing architecture, and can’t be validated cheaply — it’s not a replacement for DTA today, it’s a source of the candidate indexes DTA can’t see.

May 30, 2026 · 8 min · Kent Yao