EXPLAIN: make it make sense
October 21–24
Most developers know how to measure the time a database query takes and to find which one is the slowest. But what next? What is going on there? Is it good that it’s doing that? Is the query supposed to take this much time? Will some indexes help? In this talk, I will help you decipher database query plans and give some rules of thumb to understand if the database is doing the best it can. We will also use query plans to find the best indexes for queries by observing what the database is looking for. I will also share several anti-patterns I have seen in projects and show how to rewrite them in a database-friendly way. Although I will use Python to explain the principles and execute my queries, I will show the raw SQL to make it applicable to any programming language.