An introductory article on join ordering in database query optimization, focusing on dynamic programming approaches from the Munich school of research. The author outlines a planned 6-part series examining four foundational papers that progressively address optimal join tree generation, from basic dynamic programming algorithms to handling complex predicates and scaling to thousands of relations.
An AI agent was tasked with optimizing a slow PostgreSQL query across three database servers. While all runs eventually produced a 10x faster solution, completion times varied from 143 to 513 seconds due to unnecessary query re-runs, index creation, and result verification—behaviors the agent adopted without explicit instructions.