![]() | |
#1
| |||
| |||
|
|
Hi NG, i created a snowflake schema (one fact table and denormalized dimension tables for one dimension) in oracle 9.0.1. if i do NOT set and index, a rollup over all dimension levels is much faster than if i set and index on the primary key in the fact table (which is a foreign key to the dimension tables) and on the foreign keys of the dimension levels. dimension tables: CREATE TABLE dimension_1(dim_id INTEGER PRIMARY KEY); CREATE TABLE dimension_2(dim_id INTEGER PRIMARY KEY, parent INTEGER REFERENCES dimension_1); CREATE INDEX dimension_2_Index ON dimension_2(parent); fact table: CREATE TABLE snowflake_fact(dim_id INTEGER, value INTEGER); CREATE INDEX fact_Index ON snowflake_fact (dim_id); how come that? thanx, Stefan |
#2
| |||
| |||
|
#3
| |||
| |||
|
|
Hi NG, i created a snowflake schema (one fact table and denormalized dimension tables for one dimension) in oracle 9.0.1. if i do NOT set and index, a rollup over all dimension levels is much faster than if i set and index on the primary key in the fact table (which is a foreign key to the dimension tables) and on the foreign keys of the dimension levels. dimension tables: CREATE TABLE dimension_1(dim_id INTEGER PRIMARY KEY); CREATE TABLE dimension_2(dim_id INTEGER PRIMARY KEY, parent INTEGER REFERENCES dimension_1); CREATE INDEX dimension_2_Index ON dimension_2(parent); fact table: CREATE TABLE snowflake_fact(dim_id INTEGER, value INTEGER); CREATE INDEX fact_Index ON snowflake_fact (dim_id); how come that? thanx, Stefan |
#4
| |||
| |||
|
|
You did gather statistics on these tables and if so what does the query plan look like. I have a fair idea what's going on but a query plan of both would be the easy way to tell, you also may want to try the oracle groups. "Stefan Seidel" <sseidel (AT) uni-muenster (DOT) de> wrote Hi NG, i created a snowflake schema (one fact table and denormalized dimension tables for one dimension) in oracle 9.0.1. if i do NOT set and index, a rollup over all dimension levels is much faster than if i set and index on the primary key in the fact table (which is a foreign key to the dimension tables) and on the foreign keys of the dimension levels. dimension tables: CREATE TABLE dimension_1(dim_id INTEGER PRIMARY KEY); CREATE TABLE dimension_2(dim_id INTEGER PRIMARY KEY, parent INTEGER REFERENCES dimension_1); CREATE INDEX dimension_2_Index ON dimension_2(parent); fact table: CREATE TABLE snowflake_fact(dim_id INTEGER, value INTEGER); CREATE INDEX fact_Index ON snowflake_fact (dim_id); how come that? thanx, Stefan |
![]() |
| Thread Tools | |
| Display Modes | |
| |