Re: [Wicket-user] Paging data without using DataProvider.size() ?

2007-06-30 Thread Lec
hie Gwyn, May be this will help - read all the threads http://www.nabble.com/RE%3A--Contract-for-%22Iterator-IDataProvider.iterator%28int-first%2C-int-count%29%22-tf1395451.html#a11057660 Gwyn wrote: Hi, Anyone got any suggestions as to the best way to provide a paging

[Wicket-user] Paging data without using DataProvider.size() ?

2007-06-29 Thread Gwyn Evans
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

Re: [Wicket-user] Paging data without using DataProvider.size() ?

2007-06-29 Thread Martijn Dashorst
The most interesting questions is of course: what database? Perhaps someone here knows how to get the count(*) faster? you might want to do a select count(primary_key) instead of *. As an answer to your question: you could use Integer.MAX_VALUE. Martijn -- Wicket joins the Apache Software

Re: [Wicket-user] Paging data without using DataProvider.size() ?

2007-06-29 Thread C. Bergström
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

Re: [Wicket-user] Paging data without using DataProvider.size() ?

2007-06-29 Thread Scott Swank
Any modern database uses a cost-based optimizer to determine its query execution plans. This means that at a minimum the database knows how many rows each table contains. This means that you just have to find this metadata -- then you can use that in lieu an actual count(*). On oracle you

Re: [Wicket-user] Paging data without using DataProvider.size() ?

2007-06-29 Thread Scott Swank
Of course this metadata-level cardinality may be generated daily and hence may not be current, but for the purposes of paging it's probably entirely sufficient unless you expect a user to walk through many, many pages of data. On 6/29/07, Scott Swank [EMAIL PROTECTED] wrote: Any modern database

Re: [Wicket-user] Paging data without using DataProvider.size() ?

2007-06-29 Thread Gwyn Evans
On Friday, June 29, 2007, 12:36:34 PM, Martijn [EMAIL PROTECTED] wrote: The most interesting questions is of course: what database? Perhaps someone here knows how to get the count(*) faster? you might want to do a select count(primary_key) instead of *. As an answer to your question: you

Re: [Wicket-user] Paging data without using DataProvider.size() ?

2007-06-29 Thread Gwyn Evans
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

Re: [Wicket-user] Paging data without using DataProvider.size() ?

2007-06-29 Thread Scott Swank
There is no performance difference between count(*) and count(not_nullable_column). Stick with count(*), since it's clearer what you really want. On 6/29/07, Gwyn Evans [EMAIL PROTECTED] wrote: On Friday, June 29, 2007, 12:36:34 PM, Martijn [EMAIL PROTECTED] wrote: The most interesting

Re: [Wicket-user] Paging data without using DataProvider.size() ?

2007-06-29 Thread Al Maw
Gwyn Evans wrote: What I was wondering was if anyone had any suggestions about a table object that just did 'next'/'prev' paging, rather than working out Page N of M, although I'll try work out if select count(id) is faster/less cost than select count(*) In the past we didn't think there was