课程: Programming Foundations: Databases

今天就学习课程吧!

今天就开通帐号,24,600 门业界名师课程任您挑!

Denormalization

Denormalization

- While normalizing databases to third normal form is a best practice, occasionally there may be a business need or a database performance issue that requires violating the rules of normalization. Denormalization is the process of intentionally duplicating information in tables in violation of normalization rules. Denormalization is done after normalizing a database. It doesn't mean skipping normalization altogether. In our restaurant database, it's not likely we'll run into speed problems any time soon, but as an example of denormalization let's take a look at the Orders table. For each order we can determine the number of items included and a total price for those items. By using the OrderID we can get the associated items in the OrdersDishes table, count them up, and pull information from the Dishes table to get the price of each item and sum those up as well. We wouldn't usually store this information on the…

内容