-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
Did you find a bug?
I'm using pagination_total false on the index collection, which works fine and as expected. However, I'm noticing in the SQL debug logs that when I filter a collection (by user_id), it is still doing a SELECT COUNT(*) FROM (SELECT 1 AS one FROM "large_table" WHERE "large_table"."user_id" = 123 ORDER BY "large_table"."id" desc LIMIT $1 OFFSET $2) subquery_for_count.
Is there a way to disable this for filters? I have an extremely large table and it is causing my app to timeout.
I'm just using the default filter method on my activeadmin model
Expected behavior
Filtering large tables should not run an expensive COUNT(*) or ORDER BY (even if it is using limit and offset)
Actual behavior
Request times out
How to reproduce
Have an extremely large table and filter on an indexed column like user_id. Expect it to be relatively performant and not run things like COUNT(*) unnecessarily.