01.09.2016 Views

Beginning Oracle Database 11g Administration From Novice to Professional

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

144<br />

CHAPTER 7 PHYSICAL DATABASE DESIGN<br />

the availability of the rest of the data in the table. Global indexes are most suitable when<br />

the query does not specify the partitioning criterion. A global index may or may not be<br />

partitioned and can even have a different partition scheme than its table.<br />

Denormalization and Materialized Views<br />

Denormalization is a technique that is used <strong>to</strong> improve the efficiency of Join operations.<br />

Consider the and tables from the order management database described<br />

in <strong>Oracle</strong> <strong>Database</strong> <strong>11g</strong> Java Developer’s Guide. To avoid having <strong>to</strong> join these tables, we<br />

could replace them with a table that contains all the data items from both tables. This<br />

eliminates the need <strong>to</strong> join the two tables frequently, but it introduces its own set of problems.<br />

Observe that data items such as , , , and must now be<br />

duplicated if there is more than one line in an order; if any of these data items needs <strong>to</strong><br />

be changed, multiple data rows will have <strong>to</strong> be updated. The duplication of data thus creates<br />

the possibility that mistakes will be made.<br />

Materialized views can be used <strong>to</strong> avoid the problems created by denormalization.<br />

Instead of replacing the and tables with a denormalized table, we could<br />

prejoin the tables and s<strong>to</strong>re the results in a structure called a materialized view, as illustrated<br />

in Listing 7-8.<br />

Listing 7-8. Example of a Materialized View

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

Saved successfully!

Ooh no, something went wrong!