AXISHK
asked on
Index on Database
I have two tables and no index is defined. This is a data warehouse tables that will be loaded into MS AS Cube.
DIM_CURRENCY (CURRENCY_IDX, CURRENCYCODE, NAME, SYMBOL, RATE)
FACT_SALES_INVOICE (CURRENCY_IDX, REGION_COUNTRY, TRANSDATE, CUSTOMER_IDX, SALESMAN_IDX, BASEAMOUNT, QTY, INVOICENO, COMPANY)
What kind of index should I create on each tables ?
As there is no primary key on fact table, should I create individual index key for each attribute, or a single key combining all attributes ?
Tks
DIM_CURRENCY (CURRENCY_IDX, CURRENCYCODE, NAME, SYMBOL, RATE)
FACT_SALES_INVOICE (CURRENCY_IDX, REGION_COUNTRY, TRANSDATE, CUSTOMER_IDX, SALESMAN_IDX, BASEAMOUNT, QTY, INVOICENO, COMPANY)
What kind of index should I create on each tables ?
As there is no primary key on fact table, should I create individual index key for each attribute, or a single key combining all attributes ?
Tks
ASKER
Should I create separate logical index for each foreign key, or combine all foreign key within a single logical index ?
Tks
Tks
Normally you should create an index for each FK so will boost the JOIN between tables.
Don't create a composite index just for saving indexes.
Don't create a composite index just for saving indexes.
ASKER
One quick question, what's my consideration to create a composite index over a single index for each FK ? Tks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Only after that you should start think in another indexes but that's depends on your queries.