Project

traceindex

0.0
No release in over a year
This Rake task investigates the application's tables definition, then tells you missing indexes
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
~> 3.9

Runtime

>= 4.0.0
 Project Readme

traceindex

A Rake task that helps you find missing indexes in your Rails app.

Install

Put this line in your Gemfile:

gem 'traceindex'

Then bundle:

% bundle

Usage

Just run the following command in your Rails app directory.

% rake traceindex

If you want the rake task to fail when errors are found.

% FAIL_ON_ERROR=1 rake traceindex

If you want the rake task to ignore foreign_keys.

% IGNORE_FOREIGN_KEY=1 rake traceindex

How do I tell it to ignore columns?

Create a .traceindex.yaml or .traceindex.yml file in your root directory.

ignore_tables:
  - action_mailbox_inbound_emails
  - action_text_rich_texts
  - active_storage_attachments
  - active_storage_blobs
  - active_storage_variant_records
ignore_columns:
  - users.created_user_id
ignore_foreign_keys:
  - users.created_user_id

Copyright

Copyright (c) 2020 Akira Kusumoto. See MIT-LICENSE file for further details.