Subject Re: [firebird-support] Re: How to get best plan for typical Order–Custom er?
Author Dmitry Yemanov
kokok_kokok wrote:
>
> The suboptimal plan for
> select sum(Orders.units) from Orders inner join Customers on
> Orders.CustomerId=Customers.CustomerId
> where Orders.OrderDate between `2007/1/1' and `2007/12/31'
> and Customers.EntryDate between `2006/1/1' and `2006/12/31'
> and Customers.CustomerType=1
> is:
>
> PLAN JOIN (CUSTOMERS NATURAL, ORDERS INDEX (FK_CUSTOMERID,
> IDX_ORDER_DATE))

It seems you don't have an index for Customers.EntryDate. Is it intentional?


Dmitry