Sybase 12.4.2 User Manual

Page 185

Advertising
background image

CHAPTER 4 Adaptive Server IQ Indexes

165

Linear joins

You can think of a linear join as a tree with no branches. Each table in the
hierarchy is related to the table above it, until you reach the top table. In
Figure 4-1 on page 153. Tables A, D, and F constitute a linear join hierarchy.
Tables C, E, and F form another linear join hierarchy.

In a linear join, each pair of tables represents a one-to-many relationship, in
which the lower table of the pair is the “one” side, and the higher table of the
pair is the “many” side. Linear join hierarchies can rely on any of the
underlying join conditions: key join, natural join, or ON clause join.

Star joins

You can picture a star join as a structure with many branches, in which each
branch is directly related to one table in the middle. In Figure 4-1, Tables D, F,
and E form a very simple star join. More commonly, Table F would be at the
center of many tables, each of which is joined to Table F.

In a star join, multiple tables are related to one table at the center of the join, in
a one-to-many relationship. The one table at the center of the join represents
the “many” side of the relationship, while each of the tables around it represent
the “one” side of the relationship. Each table on the “one” side holds a set of
values with its own unique primary key. A foreign key in the table on the
“many” side of the relationship relates that table to the primary key of the table
on the “one” side of the relationship.

The “many” table at the center of the star is sometimes called the fact table.
The “one” tables related to it are called the dimension tables.

Advertising