You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by David Zonsheine <Da...@enigma.com> on 2004/10/19 16:48:15 UTC

How to optimize the query

Hello Derby Users
 
We are going to use Derby as an embedded data base for thousands of
applications we deliver to the market.
However, we have a simple database with a not so easy query that takes about
0.016 seconds in Oracle and 2.5 sec in Cloudscape (Derby).
I posted a question about hints and found out that there are no hints in
Derby right now.
We tried to see the index usage but couldn't.
 
How can I optimize a query in Derby? How do you do it? Is there a tool? Is
there a command line parameter?
 
Please help. We want to use this database.
 
David
--------------------------------------------------------------------------------------------------------------------------------------------------------------
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom
they are addressed. If you have received this email in error please notify the originator of the message.
Scanning of this message is performed by SurfControl E-mail Filter software in conjunction with  virus detection software.

Re: How to optimize the query

Posted by Sunitha Kambhampati <sk...@Yngvi.Org>.
David Zonsheine wrote:

> We tried to see the index usage but couldn't.
>
did you try to set the property derby.language.logQueryPlan=true in your 
derby.properties file or you can also set it as  a java property  
-Dderby.language.logQueryPlan=true

This property when set will print the query plans  in derby.log  

If an index is used, you will be able to see  IndexScan ResultSet....

an example :
here my tablename is SCANFIXED and index is SCANFIXEDX...

[snip]
    Index Scan ResultSet for SCANFIXED using index SCANFIXEDX at read 
committed isolation level using instantaneous share row locking chosen 
by the optimizer
[snip]


Sunitha.