I see what you mean I get the same thing with simplePaginate
select `threads`.*, (select count(*) from `replies` where `threads`.`id` = `replies`.`thread_id`) as `replies_count` from `threads` order by `created_at` desc limit 6 offset 0
But why the $limit + 1? That's a little trick to find out if there is another page of results available. We fetch one row more than required, which is later removed from the results. So we know we have to create another cursor, because there is at least one more result available that lives on the next page.