-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The default dashboard "last used" field is very expensive and should be removed #2514
Comments
@vincentwoo I'm having the exact same problem in both old versions of rails_admin and new versions. It's super expensive to load the stats page and often my app will timeout for 2-4min at a same. Is there any way to disable the stats to avoid these expensive calls? |
@shakycode The stats bar can be disabled (more on that here): RailsAdmin.config do |c|
c.actions do
dashboard do
statistics false
end
end
end You could also build your own custom dashboard in |
I did that as well, but I think it is not a good default for rails_admin to have. |
What should we do instead? |
I can. Are you open to that idea? |
Sure! |
In
dashboard.rb
, RailsAdmin does the following for every table by default:This is an ENORMOUSLY expensive call for any table that is not indexed on
updated_at
. For example, on my app:This is occasionally causing complete HTTP timeouts in my application. I don't want to add an index just to service this dashboard, either. I'm going to turn off statistics entirely because there doesn't seem to be a way to disable just this behavior, but I'd recommend either adding a flag or just showing something much easier, like the
created_at
time on the last row in the table.The text was updated successfully, but these errors were encountered: