19.06.2013 Views

DB2 UDB for z/OS Version 8 Performance Topics - IBM Redbooks

DB2 UDB for z/OS Version 8 Performance Topics - IBM Redbooks

DB2 UDB for z/OS Version 8 Performance Topics - IBM Redbooks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Star<br />

Schema<br />

Figure 3-15 Star schema<br />

The attributes of a star schema database are:<br />

► Large fact table: Like sales tables containing transactions that can be in the order of<br />

hundreds of millions, or billions of data rows.<br />

► Highly normalized design with dimensions (or snowflakes), tables to avoid maintaining<br />

redundant descriptive data in the central fact table.<br />

► Relatively small dimensions: Dimensions can be denormalized to one table (without the<br />

tables identified as “S” in Figure 3-15) or normalized in related tables in the <strong>for</strong>m of a<br />

snowflake.<br />

► Sparse “Hyper Cube”: Caused by high correlation among dimensions, leading to a sparse<br />

nature of data in the fact table; <strong>for</strong> example, product sales are dependent on the climate,<br />

there<strong>for</strong>e, the sale of shorts is more likely in a state where the people enjoy hot weather.<br />

► Fact table is dependent on the dimension tables.<br />

Star schema query<br />

Star schema query is normally a star join with the following characteristics:<br />

► Equi-join predicates between the fact and dimension tables<br />

► Local predicates on the dimension tables<br />

► Large number of tables in the query<br />

For a star join query, <strong>DB2</strong> uses a special join type called a star join if the following conditions<br />

are true:<br />

► The tables meet the conditions that are specified in the section “Star join<br />

(JOIN_TYPE=’S’)” of the <strong>DB2</strong> <strong>UDB</strong> <strong>for</strong> z/<strong>OS</strong> <strong>Version</strong> 8 Administration Guide, SC18-7413.<br />

Unlike the steps in the other join methods (nested loop join, merge scan join, and hybrid<br />

join) in which only two tables are joined in each step, a step in the star join method can<br />

involve three or more tables. Dimension tables are joined to the fact table via a<br />

multi-column index that is defined on the fact table. There<strong>for</strong>e, having a well-defined,<br />

multi-column index on the fact table is critical <strong>for</strong> efficient star join processing.<br />

► The STARJOIN system parameter is set to ENABLE, and the number of tables in the<br />

query block is greater than or equal to the minimum number that is specified in the<br />

SJTABLES system parameter.<br />

Note: The default <strong>for</strong> star join processing is DISABLE.<br />

► Another system parameter is the maximum pool size (MB) <strong>for</strong> star join SJMXPOOL.<br />

54 <strong>DB2</strong> <strong>UDB</strong> <strong>for</strong> z/<strong>OS</strong> <strong>Version</strong> 8 Per<strong>for</strong>mance <strong>Topics</strong><br />

S<br />

D<br />

Fact<br />

table<br />

D<br />

F<br />

D<br />

D<br />

S<br />

S<br />

snowflake<br />

Dimension<br />

table<br />

S<br />

S

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!