Tech Tips
Can Teradata support star schemas?
Teradata has handled "star" and "snowflake"
joins for a long time. Often, the optimizer will build
a plan that initiates a product join among several dimension
tables after qualifying them and then redistributing
the result so it can easily join the large fact table.
Teradata customers, especially those in retail, have
used this technique very effectively since 1988.
Snowflake joins occur when star tables are joined to
other tables in the query. Some of those joins can reduce
the cardinality of the star tables. The optimizer recognizes
joins that reduce cardinality and executes them prior
to performing the product join, resulting in fewer rows
and, thus, a shorter merge join phase. The algorithm
is sophisticated enough to recognize multiple star joins
in a single query and to recognize when one of the star
joins is a snowflake of another.
Most Teradata optimizations for star joins rely on a
large fact table with a composite primary index of columns
that are the equi-join fields for the dimension tables.
All of the dimension tables with a join field included
in the primary index must be included in the star join.
This allows the optimizer to join the dimension tables
to produce the composite primary index and thus execute
a high-performing merge join known as a "row hash
match scan."
Teradata is very good at dealing with queries that
do not fit a pattern, no matter what the underlying
physical model. You won't limit the type of queries
you can ask by using dimensional modeling in your Teradata
system. The Teradata optimizer can build an optimal
plan for any query involving the tables, regardless
of whether it fits the star join conventions.
For this reason, and because the Teradata optimizer
is good at delivering on complex requests, and additionally
because many users have found it easier to add subject
areas using a third normal form model, a normalized
schema is often recommended. In addition, many users
find it easier to add subject areas with a normalized
model. This recommendation is often misinterpreted to
mean that third normal form is required with Teradata,
when in fact the Teradata technology is completely neutral
when it comes to the data model.
|