Query performance analysis with Insights
Apr 20, 2023Rafer Hazen

Summary
This post introduces time-series metrics on a per-query pattern basis within PlanetScale Insights. It details how query literals are replaced with generic placeholders using Vitess's SQL parser to normalize queries for aggregation. The post provides a real-world example of identifying a slow `DELETE` query that became inefficient over time due to the lack of an index. It demonstrates how adding an index to the `minute` column significantly improved query latency, showcasing the effectiveness of the new Insights feature for performance troubleshooting.