Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

convert snowflake schema into star schema

I have the following schema

Sans titre.png

The fact table is Vente .

the code of loading dimensions

//----------------------Article-----------------------

Article:

LOAD "Code Article",

    "Libellé Article ",

    "Unité de Stock ";

SQL SELECT "Code Article",

    "Libellé Article ",

    "Unité de Stock "

FROM QlikDataWarehouseTest.dbo.Article;

//--------------------Assortiment---------------------

Assortiment:

LOAD "Code Article",

    "Code Fournisseur";

SQL SELECT "Code Article",

    "Code Fournisseur"

FROM QlikDataWarehouseTest.dbo.Assortiment;

//--------------------Fournisseur---------------------

Fournisseur:

LOAD "Code Fournisseur",

    "Libellé Fournisseur",

    Ville;

SQL SELECT "Code Fournisseur",

    "Libellé Fournisseur",

    Ville

FROM QlikDataWarehouseTest.dbo.Fournisseurs;

//--------------------Reference---------------------

Reference:

LOAD "Code Reference",

    "Code Article";

SQL SELECT "Code Reference",

    "Code Article"

FROM QlikDataWarehouseTest.dbo.Reference;

//--------------------OC---------------------

OC:

LOAD [OC1],[Code Article], [INSERTION],[Site] ;

SQL SELECT distinct  [OC] as OC1 ,[Code Article], [INSERTION] ,[Site]

FROM [QlikDataWarehouseTest].[dbo].[OC Geant]

WHERE [Code Article] IS NOT NULL

UNION ALL

SELECT distinct  [OC] as OC1 ,[Code Article], [INSERTION] ,[Site]

FROM [QlikDataWarehouseTest].[dbo].[OC MPX]

WHERE [Code Article] IS NOT NULL ;

How can I change snowflake schema into star schema to improve performance ?

7 Replies
quwok
Creator III
Creator III

Merging Fournisseur to Assortiment should turn your snowflake into a star schema. But note that only because it is a star schema doesn't make it more performant than the snowflake.

khasimvali85
Creator II
Creator II

Hi,

I am also facing issue when converting from Snowflake Schema into Star Schema.

can any one explain how to convert?

Regards,

Khasim.

Not applicable
Author

Hi

The main difference between a star and snowflake schema is that a star has only one fact table with many dimensional tables around it.  A snowflake schema has more than one fact table

So if you want to convert your snowflake to a star you need to combine your fact tables by concatenating or joining them

hic
Former Employee
Former Employee

But why do you want to convert to a star schema? In most cases the performance difference is non-existent or negligible.

And having a snowflake scheme is usually a better option when it comes to manageability.

See A Myth about the Number of Hops

HIC

awhitfield
Partner - Champion
Partner - Champion

I really wouldn't bother, you model is fine as it is!

Andy

awhitfield
Partner - Champion
Partner - Champion

Hi Chris,

not necessarily so:

In computing, a snowflake schema is a logical arrangement of tables in a multidimensional database such that the entity relationship diagram resembles a snowflake shape. The snowflake schema is represented by centralized fact tables which are connected to multiple dimensions.[citation needed]. "Snowflaking" is a method of normalising the dimension tables in a star schema. When it is completely normalised along all the dimension tables, the resultant structure resembles a snowflake with the fact table in the middle. The principle behind snowflaking is normalisation of the dimension tables by removing low cardinality attributes and forming separate tables.[1]

The snowflake schema is similar to the star schema. However, in the snowflake schema, dimensions are normalized into multiple related tables, whereas the star schema's dimensions are denormalized with each dimension represented by a single table. A complex snowflake shape emerges when the dimensions of a snowflake schema are elaborate, having multiple levels of relationships, and the child tables have multiple parent tables ("forks in the road").

Andy

Mahamed_Qlik
Specialist
Specialist

Hi Jaweher,

As Chris advised, The main difference between a star and snowflake schema is that a star has only one fact table with many dimensional tables around it.  A snowflake schema has more than one fact table.

In your scenario, you will need to create single fact table with the dimension surround to it.

You can concatenate or you can use join the different table into the single on basis of Primary key between those table.

Regards,

Mahamed