diff --git a/lib/active_admin/helpers/collection.rb b/lib/active_admin/helpers/collection.rb
index <HASH>..<HASH> 100644
--- a/lib/active_admin/helpers/collection.rb
+++ b/lib/active_admin/helpers/collection.rb
@@ -5,6 +5,7 @@ module ActiveAdmin
       # 2. correctly handles the Hash returned when `group by` is used
       def collection_size(c = collection)
         return c.count if c.is_a?(Array)
+        return c.length if c.limit_value
 
         c = c.except :select, :order
 
diff --git a/spec/unit/views/components/paginated_collection_spec.rb b/spec/unit/views/components/paginated_collection_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/views/components/paginated_collection_spec.rb
+++ b/spec/unit/views/components/paginated_collection_spec.rb
@@ -241,6 +241,15 @@ RSpec.describe ActiveAdmin::Views::PaginatedCollection do
         .not_to make_database_queries(matching: "SELECT COUNT(*) FROM \"posts\"")
     end
 
+    it "makes no COUNT queries to figure out the last element of each page" do
+      require "db-query-matchers"
+
+      undecorated_collection = Post.all.page(1).per(30)
+
+      expect { paginated_collection(undecorated_collection) }
+        .not_to make_database_queries(matching: "SELECT COUNT(*) FROM (SELECT")
+    end
+
     context "when specifying per_page: array option" do
       let(:collection) do
         posts = 10.times.map { Post.new }
Use collection length instead of running COUNTs for limited collections (#<I>)