Subject | Re: [firebird-support] Re: How to get best plan for typical Order–Custom er? |
---|---|
Author | Dmitry Yemanov |
Post date | 2008-11-15T18:08:26Z |
kokok_kokok wrote:
Dmitry
>It seems you don't have an index for Customers.EntryDate. Is it intentional?
> 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))
Dmitry