Home / Companies / Cockroach Labs / Blog / Post Details
Content Deep Dive

How to Identify and Tune a Problematic Query with SQL EXPLAIN

Blog post from Cockroach Labs

Post Details
Company
Date Published
Author
Kevin Ngo
Word Count
1,355
Language
English
Hacker News Points
-
Summary

This article provides a comprehensive guide on how to identify and tune problematic queries using SQL EXPLAIN. It covers the following steps: 1. Tagging your application when connecting to the database for easy identification of problematic queries. 2. Identifying slow queries from your application using various methods such as DB console, slow query log, and plan attributes. 3. Introspecting the query plan and tuning performance with EXPLAIN. 4. Finding performance bottlenecks with EXPLAIN ANALYZE. The article also provides examples of how to use these tools in CockroachDB, a distributed SQL database.