-
-
Notifications
You must be signed in to change notification settings - Fork 3.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
Add an option to NOT show a count for a given scope. #804
Comments
+1 This is an enormous slowdown (minutes per request) for large tables. |
Partial progress on this, as there's now an option on index to control whether scopes are counted or not, but no love on per-scope configuration it seems. |
Good news @MrJoy I have a fix written for this that will let you exclude counts on a per-scope basis like so:
|
@MrJoy @latortuga Are you by any chance on PostgreSQL? Also: It feels disabling the scope counter only alleviates the problem, as the paginator at the bottom of the list still counts? |
No, not on PostgreSQL. The problem was that some scopes represent complicated queries that aren't well indexed (or cannot be well indexed due to limitations in MySQL's ability to execute certain complex queries). The scopes are still useful to us, but we don't want to be running them ALL THE TIME. The paginator behavior is not a big enough issue to diminish the importance of the requested (and thankfully implemented!) feature. The problem was that we might have 10 scopes that each take 10 seconds to do a count on. The list view when no scopes are applied, and no scopes are defined in ActiveAdmin is plenty fast despite pagination being a bit expensive for some tables -- but when adding a scope to ActiveAdmin adds 10 seconds of overhead to any view of the list page for a model, then the scopes feature becomes quite useless. Thus, turning off counters was absolutely necessary to make ActiveAdmin's scope feature usable to us. That said, non-counted pagination as an option would be great too for a number of our tables, but that's a much lower priority. |
Thanks! |
Any progress here? Would love this feature as well .. |
@knagode what exactly is missing? You can disable scope count per scope and also disable the pagination total count. |
@javierjulio Nice. I see that |
Not all scopes are cheap to compute a count for, even if they are useful to expose in the admin UI.
A configuration option that allows us to disable the count for a given scope would be enormously useful.
The text was updated successfully, but these errors were encountered: