A systematic guide to debugging slow database queries in Rails applications. Covers built-in Rails tools including the `explain` method (with Rails 7.1 enhancements), `load_async`, ActiveSupport::Notifications, query log tags, and strict loading mode. Also covers essential gems like Bullet, rack-mini-profiler, and prosopite.
Table of contents
Understanding the ProblemRails Built in ToolsEssential Gems for Query DebuggingPostgreSQL Specific ToolsMySQL Specific ToolsSQLite Specific ToolsSolid Cache and Query PerformancePractical Debugging WorkflowMonitoring in ProductionSummaryReferencesSort: