You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Stefan Schlösser <ss...@intermediate.de> on 2004/09/03 16:22:30 UTC
endAtIndex does not seem to work on sapdb
Hi,
I am doing a simple
select * from table
and set the resultsize to 10 using
QueryByCriteria q = QueryFactory.newQuery( clazz, crit);
q.setStartAtIndex( 1);
q.setEndAtIndex( 10);
This query takes endless (180000 rows in tables) and finally causes a
table space exhausted exception.
Using the SqlGeneratorDefaultImpl log output and psting this generated
sql statement into a squirrel client results in an exceution time < 1 sec.
I am using ojb rc6, but also failed with 1.0.0. This feature seems to me
essential on a production db!
Any ideas ?
Thanks,
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: endAtIndex does not seem to work on sapdb
Posted by Armin Waibel <ar...@apache.org>.
Hi Stefan,
I made a quick test on maxDB/sapDB with 20000 objects in table. The
query look like this:
Criteria crit = new Criteria();
crit.addEqualTo("name", name);
QueryByCriteria q = QueryFactory.newQuery(Gourmet.class, crit);
q.setStartAtIndex(10);
q.setEndAtIndex(19);
==>
Query 10 of 20000 objects take 110 ms
Then I query all 20000 objects and get
==>
Query all 20000 objects take 531 ms
In the log from p6spy I see for the first case that only 10 result set
rows are read from ResultSet. In second case all rows are read from
ResultSet.
So, for me it works as expected (using latest from CVS (branch
OJB_1_0_RELEASE), but AFAIK the RsIterator stuff did not change since 1.0).
Do you use a complex criteria/target class? Do use 'extent' feature? Did
you check generated SQL with p6spy?
regards,
Armin
Stefan Schlösser wrote:
> Hi,
>
> I am doing a simple
> select * from table
> and set the resultsize to 10 using
>
> QueryByCriteria q = QueryFactory.newQuery( clazz, crit);
> q.setStartAtIndex( 1);
> q.setEndAtIndex( 10);
>
> This query takes endless (180000 rows in tables) and finally causes a
> table space exhausted exception.
>
> Using the SqlGeneratorDefaultImpl log output and psting this generated
> sql statement into a squirrel client results in an exceution time < 1 sec.
>
> I am using ojb rc6, but also failed with 1.0.0. This feature seems to me
> essential on a production db!
>
> Any ideas ?
>
> Thanks,
>
> Stefan
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: endAtIndex does not seem to work on sapdb
Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi stefan,
ojb handles the indices internally, that means there is no limit clause in the
sql-statement. it's done internally because each dbms uses it's own
implementation and some dmbs only support an end index.
jakob
Stefan Schlösser schrieb:
> Hi,
>
> I am doing a simple
> select * from table
> and set the resultsize to 10 using
>
> QueryByCriteria q = QueryFactory.newQuery( clazz, crit);
> q.setStartAtIndex( 1);
> q.setEndAtIndex( 10);
>
> This query takes endless (180000 rows in tables) and finally causes a
> table space exhausted exception.
>
> Using the SqlGeneratorDefaultImpl log output and psting this generated
> sql statement into a squirrel client results in an exceution time < 1 sec.
>
> I am using ojb rc6, but also failed with 1.0.0. This feature seems to me
> essential on a production db!
>
> Any ideas ?
>
> Thanks,
>
> Stefan
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org