Will_paginate on enormous tables

I’m using the plugin will_paginate with a table of more than 100,000
records, i also do a join with other table.
I’m wondering if will_pagination in my situation is an appropriate
choice, or whether it is better to implement something ad-hoc?

I’m using the plugin will_paginate with a table of more than 100,000
records, i also do a join with other table.
I’m wondering if will_pagination in my situation is an appropriate
choice, or whether it is better to implement something ad-hoc?

What are you experiencing that is making you doubt will_paginate? I
haven’t used it on sets that big, but if it’s underlying queries are
using LIMIT/OFFSET and appropriate indexes correctly, I don’t see why it
would be any slower than something ad-hoc…

-p

Quoting Aldo I. [email protected]:

I’m using the plugin will_paginate with a table of more than 100,000
records, i also do a join with other table.
I’m wondering if will_pagination in my situation is an appropriate
choice, or whether it is better to implement something ad-hoc?

Large joins are generally very slow. If It Were My Code (IIWMC), I’d
try it
without the join as an experiment, faking or deleting any missing
attributes.

Another alternative if, the join adds information rather than being part
of
the order, conditions, etc. is, paginate the main table and do the join
in the
view on just the page’s records. I know: ugly, bad practice, etc.

Alternately, do all the database access in your own controller code and
pass
the the lines/rows to paginate to display pretty w/ page links, etc.
IIRC,
Ryan B. has a Railscast on this or I can supply an example from my
own code.

There are multiple ways to do this. All will be more work than the
usual
way. But first you need to know where the bottleneck is.

Jeffrey