Link to home
Start Free TrialLog in
Avatar of AXISHK
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
Avatar of Vitor Montalvão
Vitor Montalvão
Flag of Switzerland image

You should have at least a primary key in both tables and a foreign key in the fact tables to guarantee the relationship between tables.
Only after that you should start think in another indexes but that's depends on your queries.
Avatar of AXISHK
AXISHK

ASKER

Should I create separate logical index for each foreign key, or combine all foreign key within a single logical index ?

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.
Avatar of AXISHK

ASKER

One quick question, what's my consideration to create a composite index over  a single index for each FK ?  Tks
ASKER CERTIFIED SOLUTION
Avatar of Vitor Montalvão
Vitor Montalvão
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial