#88 ✓resolved
Georg Ledermann

Pagination: Count optimization

Reported by Georg Ledermann | May 25th, 2009 @ 12:08 PM

It seems that the helpers for pagination are requesting the "count" from the database even if it's not needed.

Think about this: The given collection contains fewer elements than per_page AND there is no LIMIT statement (because :page param is not there). In this situation the count should not be calculated, because it will be same like collection.length.

In addition, regarding the tuturial (http://www.binarylogic.com/2008/9/7/tutorial-pagination-ordering-an...: It would be much better if the count-calculation is made implicit in the Searchlogic internals, the controller should NOT calculate the count (because it's not always needed, see above).

So far as I know, will_paginate implements this optimization.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Provides common named scopes and object based searching.

People watching this ticket