On Friday, June 29, 2007, 12:32:35 PM, C. <[EMAIL PROTECTED]> wrote: > Gwyn Evans wrote: >> Hi, >> >> Anyone got any suggestions as to the best way to provide a paging >> data view without requiring using size() to actually count the records >> in DB? >> >> I've got a site that has a production DB such that >> "select COUNT(*) from mytable" >> takes a non-trivial amount of time/cpu to return, whereas to get >> the actual data for the page is effectively immediate! >> >> I'm curently using a DefaultDataTable and the quick hack is to just >> hard-code DataProvider.size() to just return a fixed number, but while >> that's probably OK, it's sub-optimal (it is just a util for my own >> use though, really). Having said that, I'd be interested in >> alternative suggestions. >> >> It's the Production DB only that shows this behaviour (which is >> probably related to them not purging the the old data for 4 years or >> so, so I'm limited as to what might be possible with the DB itself). >> > I smell Postgres and just going to go out on a limb here.. :) triggers > that update a counts table, db maintenance, or search the postgres > "perform" archive for other ways to achieve this.. I'm pretty sure I see > this question nearly every two weeks and from what I've read and > remember it pretty much falls on the responsibility of the backend.
Oracle! :-) I've tried the "db maintenance" route but they don't want to go there - the count is only needed for the "Page N of M" NavigationHeader, but would be dynamic (when the table is filtered), so a counts table wouldn't work. I think the key this time is just to accept some loss of functionality (jumping direct to a page) is that allows me to do away with the call to size(), but I just wanted to check I wasn't missing a better way than drilling my way down into DefaultDataTable. /Gwyn ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user