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 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. > > The DB's Oracle (8i, I think), but the metadata approach doesn't help, > as if I'm using size, it should be the size for the filtered results, > which may be in effect, otherwise I might as well use a fixed result. > > 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(*)" > > /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 > -- Scott Swank reformed mathematician ------------------------------------------------------------------------- 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