db_performance
DB Performance monitors slow database queries, aggregates them using query fingerprinting, and suggests indexes to improve performance without external tools.
Features
DB Performance helps developers and site builders understand how their Drupal site interacts with the database and where performance bottlenecks occur.
Main features:
Collects slow SQL queries during normal site usage
Aggregates queries using normalization and fingerprinting
Shows statistics such as:
number of calls
average execution time
maximum execution time
Filters out irrelevant queries (cache, sessions, internal tables)
Highlights the most impactful queries
Suggests database indexes based on query structure (EXPLAIN-based, upcoming feature)
Optional manual index creation
Use cases:
Debugging slow pages
Optimizing Views and EntityQuery performance
Improving large content or e-commerce sites
Identifying missing database indexes without external tools
This module is especially useful when performance issues are caused by database access patterns rather than PHP code.
Post-Installation
After enabling the module:
Use your website normally to generate query data (important)
Navigate to:
/admin/reports/db-performance
Review collected queries and statistics
Important note:
The module needs real usage data to provide meaningful insights. It is recommended to let the site run under typical traffic conditions before analyzing results or applying optimizations.
No initial configuration is required, but optional settings (such as slow query threshold) may be added in future versions.
Additional Requirements
No additional modules or external libraries are required.
This module works with Drupal core and supports standard database drivers (MySQL, MariaDB, PostgreSQL).
Recommended modules/libraries
The module works standalone, but can be complemented by:
Devel (for general debugging)
Webprofiler (for request-level profiling)
These tools provide broader insights, while DB Performance focuses specifically on database optimization.
Similar projects
Some modules and tools provide partial overlap:
Devel / Webprofiler: show queries but do not aggregate or suggest optimizations
External tools (New Relic, Blackfire): provide deep profiling but require external services
DB Performance differs by:
working directly inside Drupal
aggregating queries over time
focusing specifically on index suggestions and database tuning
Supporting this Module
If you find this module useful, you can support development by:
reporting issues
suggesting improvements
contributing patches