Questions tagged [star-schema]

Star schema is the most basic data warehousing dimensional structure and database schema, consisting of one or more fact tables referencing any number of dimension tables.

Star schema is the most basic data warehousing (data mart) dimensional structure and database schema, consisting of one or more fact tables referencing any number of dimension tables. It is organized like:

  • Facts - event that is counted or measured. They can be at a very atomic level. Generally assigned a surogate key to ensure every row can be identified.
  • Dimensions - reference information about facts. The records contain detailed information and attributes describing the fact data. Usually assigned a surrogate primary key.

Within the data warehouse and data mart the dimension table is associated with fact tables using foreign key relationship.

Advantages

In well-designed schemas multidimensional data can be analyzed easily. They are good in decision-support environments. Some of the advantages are query speed, data load and administration. The built-in referential integrity is good but not as in highly normalized databases though.

Examples

An example star schema could have a Sales Fact with Date, Product, and Store Dimensions. Any numerical performance measurements related to Sales would also be stored in the fact, like "Quantity Sold" and "Dollar Amount of Sale". The remaining columns in the Sales Fact would be foreign keys linking to the Dimensions.

More information

354 questions
63
votes
8 answers

Star-Schema Design

Is a Star-Schema design essential to a data warehouse? Or can you do data warehousing with another design pattern?
S.Lott
  • 384,516
  • 81
  • 508
  • 779
30
votes
3 answers

Data Warehousing - Star Schema vs Flat Table

I'm trying to design a Data Warehouse for a single store of commonly required data ranging from finance systems, project scheduling systems and a myriad of scientific systems. I.e. many different data marts. I have been reading up on Data…
Calanus
  • 25,619
  • 25
  • 85
  • 120
13
votes
2 answers

Star schema, normalized dimensions, denormalized hierarchy level keys

Given the following star schema tables. fact, two dimensions, two measures. # geog_abb time_date amount value #1: AL 2013-03-26 55.57 9113.3898 #2: CO 2011-06-28 19.25 9846.6468 #3: MI 2012-05-15 94.87 4762.5398 #4: …
13
votes
4 answers

Star-schema naming conventions

Is it common practice in a star schema to prefix table names as a dimension or fact table? Is it also common practice to have column names prefixed with the table name? In my normal OLTP databases, I don't do this, but I'm seeing examples of this…
Dwight T
  • 1,457
  • 2
  • 11
  • 20
12
votes
1 answer

How to design a star schema

I am confused where should I start to design a star schema. for example I have tables in database as follows: Branch(branchNo, bStreetAddress, bCity) LoanManager(empNo, empName, phone, branchNo) Customer(custNo, custName, profession, streetAddress,…
jojo
  • 13,583
  • 35
  • 90
  • 123
12
votes
2 answers

Is a star schema a denormalized schema?

An OLAP database consists of data in denormalized form. This means data redundancy and this data redundancy helps retrieve data through less number of joins, hence facilitating faster retrieval. But a popular design for OLAP database is…
Victor
  • 16,609
  • 71
  • 229
  • 409
9
votes
8 answers

How to efficiently utilize 10+ computers to import data

We have flat files (CSV) with >200,000,000 rows, which we import into a star schema with 23 dimension tables. The biggest dimension table has 3 million rows. At the moment we run the importing process on a single computer and it takes around 15…
Rohita Khatiwada
  • 2,835
  • 9
  • 40
  • 52
9
votes
1 answer

Star schema in SQLAlchemy

I have a star-schema architectured database that I want to represent in SQLAlchemy. Now I have the problem on how this can be done in the best possible way. Right now I have a lot of properties with custom join conditions, because the data is stored…
Joakim Lundborg
  • 10,920
  • 6
  • 32
  • 39
7
votes
5 answers

PostgreSQL: Loading data into Star Schema efficiently

Imagine a table with the following structure on PostgreSQL 9.0: create table raw_fact_table (text varchar(1000)); For the sake of simplification I only mention one text column, in reality it has a dozen. This table has 10 billion rows and each…
David
  • 4,786
  • 11
  • 52
  • 80
7
votes
2 answers

Insert into a star-schema

I've read a lot about star-schema's, about fact/deminsion tables, select statements to quickly report data, however the matter of data entry into a star-schema seems aloof to me. How does one "theoretically" enter data into a star-schema db? while…
shaun
  • 73
  • 1
  • 3
7
votes
3 answers

How to get datasets name in Google BigQuery including "publicdata"

I create jdbc connection for google BigQuery as follwing Class.forName("net.starschema.clouddb.jdbc.BQDriver"); conn = DriverManager.getConnection("jdbc:BQDriver:"projectID"?transformQuery=true&user="client ID"&password="client…
user3132353
  • 129
  • 1
  • 2
  • 7
7
votes
1 answer

Python Cubes OLAP Framework - how to work with joins?

I'm trying to use python's olap framework cubes on a very simple database, but I am having some trouble joining tables. My schema looks like this: Users table ID | name Products table ID | name | price Purchases table ID | user_id | product_id |…
user1491915
  • 1,067
  • 1
  • 14
  • 19
6
votes
1 answer

How can I create on-demand reports once they become too slow for our DB?

Our App / Data We have a Python app with Users in Transactions that have Commissions, Fees, etc., with Contacts that receive EmailMessages, and which Activitys take place on (Documents uploaded, Status changes, etc.). Our Reports We generate…
orokusaki
  • 55,146
  • 59
  • 179
  • 257
6
votes
6 answers

Temporary Table Usage in SQL Server

This is a bit of an open question but I would really like to hear people opinions. I rarely make use of explicitly declared temporary tables (either table variables or regular #tmp tables) as I believe not doing so leads to more concise, readable…
Chris Simpson
  • 7,821
  • 10
  • 48
  • 68
6
votes
4 answers

How to avoid joins between fact tables in a star schema?

I'm trying to model my data warehouse using a star schema but I have a problem to avoid joins between fact tables. To give a trivial idea of my problem, I want to collect all the events who occur on my operating system. So, I can create a fact table…
Pierre
  • 1,942
  • 3
  • 23
  • 43
1
2 3
23 24