TLDR · PROGRAMMING, DESIGN & DATA SCIENCE
TRAINING A 4B MODEL TO PRODUCE 81% FASTER QUERY PLANS THAN POSTGRES
Summary from the TLDR newsletter
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.