Subject RE: [firebird-support] SQL Performance
Author Leyne, Sean
Robert,

> I need this as the ItemRef and regionref form a composite primary key
> into StockLevel. The following plan is created....
>
> PLAN JOIN (CLIENTSTOCK INDEX
>
(CLIENTSTOCK_PSLIPLINE,CLIENTSTOCK_PSLIPREF,CLIENTSTOCK_CONGNLINE,CLIENT
ST
> OCK_TRANSREF,CLIENTSTOCK_CONSIGNREF),STOCKLEVEL
> INDEX (STOCKLEVEL_PK),ITEMNAME INDEX (ITEMNAME_ITEMREF),CLIENTORDERS
> INDEX (CLIENTORDERS_CLORDERREF),CLIENT INDEX (CLIENT_ENTITYREF))
>
> StockLevel_PK is ItemRef, RegionRef

Can you change the order of the columns?

If your example is indicated of a general way you define your SELECT
(i.e. limiting by RegionRef) then re-ordering the columns in the index
will make a big difference.

If you can't, then I would create a new index with the columns
re-ordered.


Sean