If you check the source code for per
method you'll see
# Specify the <tt>per_page</tt> value for the preceding <tt>page</tt> scope
# Model.page(3).per(10)
def per(num)
if (n = num.to_i) <= 0
self
else
limit(n).offset(offset_value / limit_value * n)
end
end
so your code is something like
Video.limit(2).limit(20).count
which gives
irb(main):002:0* Video.count
=> 4
irb(main):003:0> Video.limit(2).count
=> 2
irb(main):004:0> Video.limit(2).limit(4).count
=> 4
irb(main):005:0> Video.limit(4).limit(10).to_sql
=> "SELECT TOP (10) [Video].* FROM [Video]"
SQL output may be different for different DBMS but count
should give same values