A Ruby gem that scans Rails models to suggest missing database indexes and generates SQL migration scripts.
lol_dba is a Ruby gem designed for Rails applications that automates the detection of missing database indexes. It scans model associations to suggest columns that should be indexed and can generate SQL migration scripts to apply those changes. This helps improve query performance and prevent common database bottlenecks.
Rails developers and database administrators who want to optimize application performance by ensuring proper database indexing without manual inspection.
Developers choose lol_dba for its simplicity and automation—it quickly identifies indexing gaps and generates ready-to-use SQL migrations, saving time over manual analysis. Its compatibility with multiple Rails versions and seamless rake integration make it a practical tool for maintaining database efficiency.
lol_dba is a small package of rake tasks that scan your application models and displays a list of columns that probably should be indexed. Also, it can generate .sql migration scripts.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Scans Rails model associations to suggest missing indexes, saving manual inspection time as demonstrated by the `lol_dba db:find_indexes` command in the README.
Generates .sql migration scripts for pending or specific migrations, facilitating easy database updates via commands like `lol_dba db:migrate_sql` per the README examples.
Integrates with Rails' rake command for a familiar workflow, allowing use of `rake db:find_indexes` after adding the gem, as outlined in the installation steps.
Supports Ruby 2.x/3.x and Rails from 3.x to 8.x, ensuring usability across many projects, as explicitly stated in the compatibility section of the README.
Only analyzes model associations, potentially missing indexes needed for custom queries, window functions, or columns not covered by Rails conventions, limiting its comprehensiveness.
Suggests indexes based on associations without verifying actual query performance impact, which could lead to unnecessary indexes if not manually reviewed for efficiency.
Lacks features like index size analysis, dependency tracking, or integration with database-specific tools, making it less suitable for complex optimization scenarios beyond basic audits.