Hello,

     In a select statement there are two tables joined by a single 
matching field, with search conditions in both of them. One of them has 
roughly 130000 records, while the other has 600.

     Inspecting the plan generated by the optimizer, I realized that it 
uses the shorter one as the controlling stream instead of the longer one 
(i.e. the shorter table is at the left side).

     Using a PLAN expression with the corresponding indexes to bypass 
the plan deviced by the optimizer in order to switch the order of the 
streams, the performance is boosted (nearly three times faster).

     What can cause the optimizer to pick a shorter table as the 
controlling stream ?

     Is there a workaround to induce the optimizer to select the streams 
in a fixed way or should I have to resort to a manually imposed PLAN ?

Thanks,
Aldo



------------------------------------

------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ 

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------------

Yahoo Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/firebird-support/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo Groups is subject to:
    https://info.yahoo.com/legal/us/yahoo/utos/terms/

Reply via email to