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 Tino Schöllhorn <t....@tiscali.de> on 2004/07/26 13:17:54 UTC

Debugging Queries

Hi,

I am using MySQL and OJB and now I want to create a Query over a large 
table. For performance reason I want to use the "pageing"-feature - but 
I have the feeling that currently OJB is somehow ommitting this (the 
result is fine - but the SQL seems not to include the LIMIT-clause).

Is there a way to get the native SQL from a query which OJB would send 
to the database (this would help for other, complex queries too).

With regards
Tino


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Debugging Queries

Posted by Craig Andrews <cr...@simplyspiffing.com>.
Tino Schöllhorn wrote:
> I am using MySQL and OJB and now I want to create a Query over a large 
> table. For performance reason I want to use the "pageing"-feature - but 
> I have the feeling that currently OJB is somehow ommitting this (the 
> result is fine - but the SQL seems not to include the LIMIT-clause).
> 
> Is there a way to get the native SQL from a query which OJB would send 
> to the database (this would help for other, complex queries too).

A database specific way would be to add the line:

log=/path/to/some/file.log

to my.cnf, which would cause MySQL to write each and every query it 
receives out to file.log. You can then just monitor what goes in there. 
Unfortunately, there is a large performance penalty, but it can be handy 
for debugging whole transactions.

-- 
Craig

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Debugging Queries

Posted by Tino Schöllhorn <t....@tiscali.de>.
Hi Thomas,

I am perfectly aware of that - but in my opinion you're already doing 
the right thing: emulate the behaviour of paging when the underlying db 
isn't supporting it. But if the underlying db is supporting this feature 
(many db implement this: mysql, mssql, oracle...) it should be used 
because one can have dramatically network and performance increases.

With regards
Tino

Thomas Dudziak wrote:

> Jakob Braeuchi wrote:
> 
>> hi tino,
>>
>> i do have an implementation using limit, but i think it's not finished 
>> yet.
> 
> 
> Please be aware that not all databases support limits in sql (e.g. McKoi).
> Btw, do we use paging resultsets ? In that case, we might not need 
> limits as the driver can optimize via cursors, or not ?
> 
> Tom


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Debugging Queries

Posted by Thomas Dudziak <to...@first.fhg.de>.
Jakob Braeuchi wrote:

> hi tino,
>
> i do have an implementation using limit, but i think it's not finished 
> yet.

Please be aware that not all databases support limits in sql (e.g. McKoi).
Btw, do we use paging resultsets ? In that case, we might not need 
limits as the driver can optimize via cursors, or not ?

Tom


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Debugging Queries

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi tino,

i do have an implementation using limit, but i think it's not finished yet.

jakob

Tino Schöllhorn schrieb:

> Hi Jakob,
> 
> thanks for your answer. Will that feature be implemented in OJB 1.1? We 
> have some queries where that feature is important for us. If this is 
> just a matter of the MySQLPlatform-Implementation I could help out....or 
> is this a general problem?
> 
> With regards Tino
> 
> Jakob Braeuchi wrote:
> 
>> hi tino,
>>
>> ojb does not use the limit-clause yet. the paging is implemented by 
>> positioning the cursor in the resultset.
>>
>> jakob
>>
>> Tino Schöllhorn schrieb:
>>
>>> Hi,
>>>
>>> I am using MySQL and OJB and now I want to create a Query over a 
>>> large table. For performance reason I want to use the 
>>> "pageing"-feature - but I have the feeling that currently OJB is 
>>> somehow ommitting this (the result is fine - but the SQL seems not to 
>>> include the LIMIT-clause).
>>>
>>> Is there a way to get the native SQL from a query which OJB would 
>>> send to the database (this would help for other, complex queries too).
>>>
>>> With regards
>>> Tino
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Debugging Queries

Posted by Tino Schöllhorn <t....@tiscali.de>.
Hi Jakob,

thanks for your answer. Will that feature be implemented in OJB 1.1? We 
have some queries where that feature is important for us. If this is 
just a matter of the MySQLPlatform-Implementation I could help out....or 
is this a general problem?

With regards Tino

Jakob Braeuchi wrote:

> hi tino,
> 
> ojb does not use the limit-clause yet. the paging is implemented by 
> positioning the cursor in the resultset.
> 
> jakob
> 
> Tino Schöllhorn schrieb:
> 
>> Hi,
>>
>> I am using MySQL and OJB and now I want to create a Query over a large 
>> table. For performance reason I want to use the "pageing"-feature - 
>> but I have the feeling that currently OJB is somehow ommitting this 
>> (the result is fine - but the SQL seems not to include the LIMIT-clause).
>>
>> Is there a way to get the native SQL from a query which OJB would send 
>> to the database (this would help for other, complex queries too).
>>
>> With regards
>> Tino
>>
>>
>> ---------------------------------------------------------------------
>> 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: Debugging Queries

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi tino,

ojb does not use the limit-clause yet. the paging is implemented by positioning 
the cursor in the resultset.

jakob

Tino Schöllhorn schrieb:

> Hi,
> 
> I am using MySQL and OJB and now I want to create a Query over a large 
> table. For performance reason I want to use the "pageing"-feature - but 
> I have the feeling that currently OJB is somehow ommitting this (the 
> result is fine - but the SQL seems not to include the LIMIT-clause).
> 
> Is there a way to get the native SQL from a query which OJB would send 
> to the database (this would help for other, complex queries too).
> 
> With regards
> Tino
> 
> 
> ---------------------------------------------------------------------
> 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