Questions tagged [snowflake-schema]

**Snowflake schema** is special case of the database Star Schema, where one or many dimension tables are normalized. This is often done for improving the performance in some cases of the Star Schema. When the dimension tables are completely normalized, the resulting structure resembles a snowflake with the fact tables in the middle.

Snowflake schema is a logical arrangement of tables in a multidimensional database in which the dimensions are expressed by more than one table. The dimension tables that relate to the facts table represent the smallest granularity of data-analysis. The other tables in the same dimension represent aggregators of dimension's individual elements. When a dimension is aggregated by several independent criteria, the diagram resembles the shape of a snowflake. Used in data warehouses.

Methods for creating Snowflake Schema out of Star Schema:

  • Partially or fully normalize one or many dimension tables, leaving other dimensions unchanged.
  • Partially or fully normalize all dimension tables.

When to use

Query performance takes the highest significance in a data warehouse and snowflaking can hamper the performance. It very useful for cases, when some attributes like demographic attributes are browsed more then the whole customer table itself. Another case is for precalculated summaries derived from a fact table. This helps not aggregating over and over again since the operation is expensive.

Advantages

Savings in the storage space. Normalized structures are having no insertion, deletion or update anomalies. Easier to update and maintain.

Disadvantages

Schemas are less intuitive, with higher complexity and abstraction. Difficult browsing through the contents for users. Additional joins - worse query performance in some cases.

Example

Having a fact table called "Sales" and dimension table called "Product". Assume there are 500000 product dimension rows. These products can fall under 10 brands. For running query for products, not indexed on brands, the query will have to search through 500000 rows to find all brands.

On the other hand, if the "Product" table partially normalized, separated on another table "Brand" the initial search query would need to go through just 10 rows on.

External links

893 questions
0
votes
1 answer

Best approach to monitor schema change on Snowflake database?

Could anyone suggest best approach to monitor schema change of Snowflake database? I would to trigger my app when any schema changes, and furthermore, I would trigger my app when any permission changes.
0
votes
5 answers

Snowflake Performance issues when querying large tables

I am trying to query a table which has 1Tb of data clustered by Date and Company. A simple query is taking long time Posting the query and query profile SELECT sl.customer_code, qt_product_category_l3_sid, qt_product_brand_sid, …
0
votes
1 answer

What is the SQL Server equivalent Table Type in Snowflake

In my SQL server procedure am having a input as TVP . Is there any possible ways to achieve this in Snowflake?
Shahul
  • 99
  • 3
  • 8
0
votes
1 answer

Use Case for External Tables?

Came across external tables in Snowflake. Could you please share some use cases or benefits for using external tables?
0
votes
1 answer

Query time out issue in snowflake

I am getting a query time out problem when the query fails to execute within 45 seconds. I need some advice on how to set query time out for snowflake. FYI, I have tried using query_Timeout parameter in connection string which was mentioned in…
0
votes
2 answers

Decrypt in Snowflake using Unix command

I am facing an issue where I have to decrypt a db column in Snowflake.The transformation to decrypt the column is a unix command.How do I achieve this decryption in Snowflake.
0
votes
1 answer

error "Unsupported subquery type cannot be evaluated" in snowflake

I am seeing the following error when I run the below code. Unsupported subquery type cannot be evaluated When I comment the third select statement and run the query, the query is running with the result. This error is popping up at the last…
Akhira
  • 203
  • 2
  • 5
  • 16
0
votes
1 answer

Failed while trying to upload file to snowflake

I registered a snowflake trail account and I tried to upload local file to snowflake. following the tutorial https://docs.snowflake.net/manuals/user-guide/data-load-internal-tutorial.html I am on windows platform and it is failing when I run the put…
Stay Foolish
  • 3,636
  • 3
  • 26
  • 30
0
votes
1 answer

HR Data Mart Design Advice

I am working on a design for an HR data mart using the Kimball approach outlined in 'The Data Warehouse Toolkit'. As per the Kimball design, I was planning to have a time-stamped, slowly-changing dimension to track employee profile changes (to…
brymann
  • 1
  • 2
0
votes
1 answer

How to convert pivot column structure to dimension table

I want to convert a table structure with pivoted columns into a dimension table and fact table. how to create a medication dimension table from the data with below structure with model enforcing star schema
0
votes
0 answers

parquet file format for snowflake connector

I am writing a table in Hadoop to Snowflake using the Spark Connector, but my file in Hadoop is in Apache Parquet. While writing in Snowflake it is writing in csv format, and it applies the default delimiter "," but I need to apply "^" as the…
0
votes
1 answer

Can Snowflake DB UDF's execute SQL commands?

I have a requirement in Snowflake where I must generate a bit of SQL and then execute it to create a new table. I have successfully generated the create table statement by creating a UDF (hard-coded at the moment) CREATE OR REPLACE FUNCTION…
0
votes
1 answer

If datamart is logical division of datawarehouse , then what is it corresponding in a datalake?

If datamart is logical division of datawarehouse , then what is it corresponding in a datalake? Also is there any design being followed in datalake like star or snowflake schema?
Dileep Dominic
  • 499
  • 11
  • 23
0
votes
1 answer

User defined schemas in data warehouse

I have about 7-8 user-defined schemas (Reference, Finance, Admin, ORG, etc) in my OLTP database. I do have ODS db which is almost a replica on OLTP. I want to build a data warehouse for this. How many schemas are recommended while building a…
user4628567
0
votes
2 answers

DWH not a Star-Schema not a Snow flake not a E-R

I m aware aboud litterature/Theorie for datawarehouse-architecture and how should be design. The Bill-Imon E-R 3NF or the Kimball Star-Schema/Snow - flake Schema. The problem come when i currently work in a DWH and it have no either any of these…