When database issues arise, tracking queries on a running system is a challenging task. Existing solutions can cause additional system load or only capture a small subset of queries. To address this, PlanetScale now tracks query statistics without any overhead using Vitess to monitor how many times a query runs, rows it returns, and its completion time. This provides a complete view of query traffic on the database, enabling developers to debug queries and make changes to their application or deploy new indexes with non-blocking schema changes. By flagging long-running queries, PlanetScale aims to optimize performance and improve user experience. The company has also optimized a slow query by analyzing query statistics and MySQL explain plans, reducing its execution time from 719ms to under 20ms.