Optimizing Postgres Queries with Visualizations and LLMs
September 30 - October 2
In this session we will talk through optimizing a Postgres query end-to-end. Taking a specific slow query, we'll explain how we assess what parts of query optimization to focus on, and which theories we have as to why the query is slow, such as Postgres picking the wrong index, or choosing a bad query plan.
We then progress through the optimization problem in two ways: (1) The human approach - utilizing purpose-built visualizations we've built for pganalyze, such as a special EXPLAIN Grid view, as well as the EXPLAIN Compare feature. For the visualizations we'll talk through the "why" it was built that way, in addition to solving the problem at hand. (2) The "AI" approach - using LLM-based tools like Claude Code to drive a query optimization and test different variants, and using visualizations as evidence on what was tried, and what changes were proposed by the LLM.
We'll conclude with best practices for engineers and DBAs to solve query bottlenecks, how tools like pganalyze and Claude Code can work together to make it easier, and what we look at as the role of visualizations in this new environment.