Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

avoid doing count on last page

#92

I tried my hand at implementing this but the way options are parsed and shuffled around makes a bit tricky. Here's the gist:

When we get the result set, if the size of it is less than per_page, we're definitely on the last page. In that case total entries is equal to offset + size and we can safely skip the count.

This should be a improvementn on sites with many paginated areas that only have 1 page.

Reported by Elijah Miller · August 24th, 2007 @ 01:16 PM

State: resolved
Milestone: none
Assigned to: Mislav Mislav

Activity

  1. Chris Wanstrath
    Chris Wanstrath
    • Assigned user changed from Chris Wanstrath to Mislav
    • State changed from new to open

    August 24th, 2007 @ 06:11 PM

  2. Chris Wanstrath
    Chris Wanstrath
    • State changed from open to resolved

    (from [388]) Will Paginate lazy counting! Counting is done after the SELECT, but skipped entirely if Finder figures out that this is the last page. We are talking about saving us trips to the db here. Thanks, Elijah Miller. [#92 state:resolved]

    http://plugins.require.errtheblo...

    September 27th, 2007 @ 03:09 AM

  3. Elijah Miller
    Elijah Miller

    That was a bit more involved than I expected!

    Thanks for the hard work!

    September 27th, 2007 @ 03:20 AM

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.