This content has been marked as final.
Show 4 replies
-
1. Re: ebjQl, ho do I get COUNT while using LIMIT/OFFSET
triathlon98 Aug 10, 2004 8:16 AM (in response to silviomatthes)I think there is no alternative but using count(*).
If Jboss needs to count the number of records in the DB, then the resultset will need to be traversed, causing an even bigger bottleneck.
Joachim -
2. Re: ebjQl, ho do I get COUNT while using LIMIT/OFFSET
silviomatthes Aug 11, 2004 5:16 AM (in response to silviomatthes)Hello again,
If Jboss needs to count the number of records in the DB, then the resultset will need to be traversed
I don't think so. JBoss calls the database without any LIMIT/OFFSET-clauses and gets back a collection/resultset of primary-keys. It should only do a size() or something similar (I don't know exactly what's the resulttype) to the resultset.
Maybe that's kind of a feature-request, but I hoped to get that count without changes to JBoss.
So, again some questions:
Is the information about the resultsetsize known in jboss after the database-call?
Is it possible to get this information from JBoss?
If no, what changes should be made to get this information?
I think that I'm not the only one who could benefit from this feature, because everytime a big resultset should be displayed in pages (best made with LIMIT/OFFSET) the overall-count of the resultset is useful.
Kind Regards,
Silvio -
3. Re: ebjQl, ho do I get COUNT while using LIMIT/OFFSET
triathlon98 Aug 11, 2004 8:40 AM (in response to silviomatthes)"SilvioMatthes" wrote:
Hello again,If Jboss needs to count the number of records in the DB, then the resultset will need to be traversed
I don't think so. JBoss calls the database without any LIMIT/OFFSET-clauses and gets back a collection/resultset of primary-keys. It should only do a size() or something similar (I don't know exactly what's the resulttype) to the resultset.
Thing is that whether this returns a "real" result is IIRC database-dependent.
Joachim -
4. Re: ebjQl, ho do I get COUNT while using LIMIT/OFFSET
aloubyansky Aug 12, 2004 7:16 AM (in response to silviomatthes)There is no size() method on ResultSet. And no way to know the number of elements thrown away with limit/offset.