I have a redshift table in the billions of records, lets call it SomeModel
.
ActiveAdmin.register Redshift::SomeModel do
menu parent: 'Redshift'
config.filters = true
config.sort_order = '' <-- I figured out this removes the order by, which is intentional
filter :message_uuid, as: :string
filter :epoch, as: :numeric
index pagination_total: false do
column :message_uuid, sortable: false
column :epoch, sortable: false
column :status, sortable: false
actions
end
However as you can see, the table gets called 3 times. 2 of which is doing some sort of sub query. (this is local log)
When I explore the trace on newrelic, you can see the 3 queries are very costly. A 46 second response time is no beauno. I'm not really sure what the 2 counts are doing, and why its done twice. How can I remove those count queries?