plentz / lol_dba

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.
1.59k stars 69 forks source link

Intercept Arel calls to suggest indexes #101

Open plentz opened 5 years ago

plentz commented 5 years ago

Intercept Arel querys to allow query specific indexes. Maybe something like this:

LolDba.suggest_index do
  Customer.where(name: 'Diego')
end

And we suggest an index on name

related: https://github.com/rails/rails/tree/master/activerecord/lib/arel