[Dbix-class] extended paging

Matija Grabnar matija at serverflow.com
Mon Nov 30 22:17:43 GMT 2009


I don't think you'll find a way to use the builtin paging functions if 
you later throw some rows away.
You'll have to do the paging by hand. It's even worse than that: The way 
you have things set up,
if you want to show page 100, you won't know where it starts unless you 
parse ALL the rows in the
preceding 99 pages. It will work if you only get a few pages usually, 
but if you get high page numbers,
the whole thing will collapse.

You COULD create a page-index table that would contain row indexes for 
the start of each page in the
CD table, but it's the same problem as before: you need another table, 
and it contains the pre-processed data.

But yes, the best solution would be to have a localizations table where 
the localizations are
precomputed - then you would just join that to the CD table and the 
paging would work automagically.

Face it: unless you can create some table with the data pre-processed 
(page - index table, pre-localized table, or something else) you will 
HAVE to churn through all the rows, localizing each one each time
in order to get the paging to work.

Find a way to get that extra table, is my advice.





More information about the DBIx-Class mailing list