[ 
https://issues.apache.org/jira/browse/DERBY-4818?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12914464#action_12914464
 ] 

Rick Hillegas commented on DERBY-4818:
--------------------------------------

Hi Trung,

You may be interested in reading this high level description of the Derby 
optimizer: http://db.apache.org/derby/papers/optimizer.html The Derby optimizer 
considers left-deep join trees. That means that for a query with N tables, the 
time spent optimizing the query is roughly proportional to N! . As the number 
of tables grows, the number of possible plans mushrooms.

Hope this is useful,
-Rick

> Derby is taking a long time to parse SQLs with more than 9 tables for the 
> first time.
> -------------------------------------------------------------------------------------
>
>                 Key: DERBY-4818
>                 URL: https://issues.apache.org/jira/browse/DERBY-4818
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.4.1.3
>         Environment: All OS platforms and all JVM versions on Derby 10.4.1.3
>            Reporter: Trung Tran
>
> I have SQLs with 9 or more tables and it takes a couple of minutes to compile 
> these SQLs for the first time.  I'm assuming that the optimizer is taking a 
> long time to figure out the query plan.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to