Subject | RE: [firebird-support] SQL Performance |
---|---|
Author | Leyne, Sean |
Post date | 2005-01-26T00:08:58Z |
Robert,
ST
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
> I need this as the ItemRef and regionref form a composite primary key(CLIENTSTOCK_PSLIPLINE,CLIENTSTOCK_PSLIPREF,CLIENTSTOCK_CONGNLINE,CLIENT
> into StockLevel. The following plan is created....
>
> PLAN JOIN (CLIENTSTOCK INDEX
>
ST
> OCK_TRANSREF,CLIENTSTOCK_CONSIGNREF),STOCKLEVELCan you change the order of the columns?
> INDEX (STOCKLEVEL_PK),ITEMNAME INDEX (ITEMNAME_ITEMREF),CLIENTORDERS
> INDEX (CLIENTORDERS_CLORDERREF),CLIENT INDEX (CLIENT_ENTITYREF))
>
> StockLevel_PK is ItemRef, RegionRef
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