Re: Left-Join extremely slow in comparison to Inner-Join. How to tune Derby?
Hello, Witold: thanks for your response. It might be the same issue and I will try to follow the same suggestions that Bryan gave you. FYI: I am using Derby 10.6.2.1 If any of the Derby folks can shed some additional light onto this, it would be greatly appreciated, Pavel. From: Witold Szczerba To: Derby Discussion Date: 01/05/2011 01:37 PM Subject: Re: Left-Join extremely slow in comparison to Inner-Join. How to tune Derby? Hi there, Look at this: https://issues.apache.org/jira/browse/DERBY-4595 Do you think it might be the same case I had some time ago? There were some changes in the code in Jun/2010, maybe you have older version or the change did not resolved the problem... The funny thing is that the Apache Derby guys changed the issue type from bug to improvement - so, for them, a query which should last 2 or 3 seconds is executing like 1 hour, fetching entire database, is just a 'feature' :/ Regards, Witold Szczerba Jefferies archives and monitors outgoing and incoming e-mail. The contents of this email, including any attachments, are confidential to the ordinary user of the email address to which it was addressed. If you are not the addressee of this email you may not copy, forward, disclose or otherwise use it or any part of it in any form whatsoever. This email may be produced at the request of regulators or in connection with civil litigation. Jefferies accepts no liability for any errors or omissions arising as a result of transmission. Use by other than intended recipients is prohibited. In the United Kingdom, Jefferies operates as Jefferies International Limited; registered in England: no. 1978621; registered office: Vintners Place, 68 Upper Thames Street, London EC4V 3BJ. Jefferies International Limited is authorised and regulated by the Financial Services Authority.
Re: Left-Join extremely slow in comparison to Inner-Join. How to tune Derby?
Hi there, Look at this: https://issues.apache.org/jira/browse/DERBY-4595 Do you think it might be the same case I had some time ago? There were some changes in the code in Jun/2010, maybe you have older version or the change did not resolved the problem... The funny thing is that the Apache Derby guys changed the issue type from bug to improvement - so, for them, a query which should last 2 or 3 seconds is executing like 1 hour, fetching entire database, is just a 'feature' :/ Regards, Witold Szczerba
Fw: Left-Join extremely slow in comparison to Inner-Join. How to tune Derby?
In addition, what seems to be odd is that fetching the data takes most of the time from the total time. For example (snapshot from Aqua Data Studio retrieving the data from the Derby in-memory table): Would it be considered normal to take over 2 minutes to fetch 2,357 records? Here is the same snapshot when the Left-Join was converted to the Inner-Join: - Forwarded by Pavel Bortnovskiy/JEFCO on 01/05/2011 12:12 PM - From: Pavel Bortnovskiy/JEFCO To: "Derby Discussion" Date: 01/05/2011 12:04 PM Subject: Left-Join extremely slow in comparison to Inner-Join. How to tune Derby? Hello, all: I am using Derby as an in-memory DB. While executing a complex query (which contains a union and several left-joins), we discovered that this query with a left join would take about 3.5 mins to execute and fetch the data, whereas the same query with the left join replaced with the inner join would take just 30 seconds. What tools or API is available at our disposal to tune the in-memory Derby, to see its execution plan, to try to figure out why it is taking such an extraordinary time to fetch about 2,500-3000 records. I also noticed that by running the same query over and over, the time to execute and fetch seems to be slowly creeping up as well - it started with 2.5 mins, then grew to 3 mins and now it's almost 4 mins. Any help would be greatly appreciated! Regards, Pavel. Jefferies archives and monitors outgoing and incoming e-mail. The contents of this email, including any attachments, are confidential to the ordinary user of the email address to which it was addressed. If you are not the addressee of this email you may not copy, forward, disclose or otherwise use it or any part of it in any form whatsoever. This email may be produced at the request of regulators or in connection with civil litigation. Jefferies accepts no liability for any errors or omissions arising as a result of transmission. Use by other than intended recipients is prohibited. In the United Kingdom, Jefferies operates as Jefferies International Limited; registered in England: no. 1978621; registered office: Vintners Place, 68 Upper Thames Street, London EC4V 3BJ. Jefferies International Limited is authorised and regulated by the Financial Services Authority.<><>
Left-Join extremely slow in comparison to Inner-Join. How to tune Derby?
Hello, all: I am using Derby as an in-memory DB. While executing a complex query (which contains a union and several left-joins), we discovered that this query with a left join would take about 3.5 mins to execute and fetch the data, whereas the same query with the left join replaced with the inner join would take just 30 seconds. What tools or API is available at our disposal to tune the in-memory Derby, to see its execution plan, to try to figure out why it is taking such an extraordinary time to fetch about 2,500-3000 records. I also noticed that by running the same query over and over, the time to execute and fetch seems to be slowly creeping up as well - it started with 2.5 mins, then grew to 3 mins and now it's almost 4 mins. Any help would be greatly appreciated! Regards, Pavel. Jefferies archives and monitors outgoing and incoming e-mail. The contents of this email, including any attachments, are confidential to the ordinary user of the email address to which it was addressed. If you are not the addressee of this email you may not copy, forward, disclose or otherwise use it or any part of it in any form whatsoever. This email may be produced at the request of regulators or in connection with civil litigation. Jefferies accepts no liability for any errors or omissions arising as a result of transmission. Use by other than intended recipients is prohibited. In the United Kingdom, Jefferies operates as Jefferies International Limited; registered in England: no. 1978621; registered office: Vintners Place, 68 Upper Thames Street, London EC4V 3BJ. Jefferies International Limited is authorised and regulated by the Financial Services Authority.