Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Using will_paginate without using SELECT COUNT(*) query
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jonathan Lin Ern Sheong  
View profile  
 More options Nov 8 2012, 6:13 am
From: Jonathan Lin Ern Sheong <ernshe...@gmail.com>
Date: Thu, 8 Nov 2012 03:13:32 -0800 (PST)
Local: Thurs, Nov 8 2012 6:13 am
Subject: Using will_paginate without using SELECT COUNT(*) query

Is there a way to configure will_paginate to not count using COUNT(*)? I
have a complex query and COUNT(*) is slowing the system down

Thanks,
Jon


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joel Jackson  
View profile  
 More options Mar 7, 4:55 pm
From: Joel Jackson <jackson.j...@gmail.com>
Date: Thu, 7 Mar 2013 13:55:43 -0800 (PST)
Local: Thurs, Mar 7 2013 4:55 pm
Subject: Re: Using will_paginate without using SELECT COUNT(*) query

For the edification of anyone who shows up here, the count * is used to
fill in total_entries and finding the number of pages.

If you need to work around this, you can use the :total_entries parameter,
aka:

Screenshot.paginate(:per_page => 20, :page => 1, :total_entries => 400)

Then when the paginator is rendered it will have 20 as it's highest page.

Cheers!

On Thursday, November 8, 2012 3:13:33 AM UTC-8, Jonathan Lin Ern Sheong
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions Older topic »