TLDR Tech / Data
Training a 4B model to produce 81% faster query plans than Postgres
Query optimizers continue to leave much to be desired despite an enormous body of research. A Postgres database should know everything about the stuff that lives in its tables, but the problem is enormously hard. What's not as hard is verifying whether a query plan an optimizer picks is good or not. Language models are particularly good at learning how to do tasks with easily verifiable outputs. A small, open-weights model can be post-trained via supervised fine-tuning and agentic reinforcement learning to produce Postgres query plans that beat Postgres' default plans.
Read the full story