• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • MsSql
  • Mysql
  • oracle
  • MariaDB
  • DB2
  • SQLite
  • PostgreSQL
  • MongoDB
  • Redis
  • Access
  • 数据库其它
  • sybase
  • HBase
您的位置:首页 > 数据库 >Mysql > Normalization VS Denormalization [转]

Normalization VS Denormalization [转]

作者:匿名 字体:[增加 减小] 来源:互联网 时间:2018-12-05

匿名通过本文主要向大家介绍了Normalization,Denormalization等相关知识,希望本文的分享对您有所帮助

Denormalizationis the process of attempting to optimize the read performance of adatabaseby adding redundant data or by grouping data.In some cases, denormalization helps cover up the inefficiencies inherent inrelationaldatabase software.

Denormalization is the process of attempting to optimize the read performance of a database by adding redundant data or by grouping data. In some cases, denormalization helps cover up the inefficiencies inherent in relational database software. A relational normalized database imposes a heavy access load over physical storage of data even if it is well tuned for high performance.

A normalized design will often store different but related pieces of information in separate logical tables (called relations). If these relations are stored physically as separate disk files, completing a database query that draws information from several relations (a join operation) can be slow. If many relations are joined, it may be prohibitively slow. There are two strategies for dealing with this. The preferred method is to keep the logical design normalized, but allow the database management system (DBMS) to store additional redundant information on disk to optimize query response. In this case it is the DBMS software's responsibility to ensure that any redundant copies are kept consistent. This method is often implemented in SQL as indexed views (Microsoft SQL Server) ormaterialized views (Oracle). A view represents information in a format convenient for querying, and the index ensures that queries against the view are optimized.

The more usual approach is to denormalize the logical data design. With care this can achieve a similar improvement in query response, but at a cost—it is now the database designer's responsibility to ensure that the denormalized database does not become inconsistent. This is done by creating rules in the database called constraints, that specify how the redundant copies of information must be kept synchronized. It is the increase in logical complexity of the database design and the added complexity of the additional constraints that make this approach hazardous. Moreover, constraints introduce a trade-off, speeding up reads (SELECT in SQL) while slowing down writes (INSERT, UPDATE, and DELETE). This means a denormalized database under heavy write load may actually offerworse performance than its functionally equivalent normalized counterpart.

A denormalized data model is not the same as a data model that has not been normalized, and denormalization should only take place after a satisfactory level of normalization has taken place and that any required constraints and/or rules have been created to deal with the inherent anomalies in the design. For example, all the relations are in third normal form and any relations with join and multi-valued dependencies are handled appropriately.

Examples of denormalization techniques include:

  • Materialized views, which may implement the following:
  • Storing the count of the "many" objects in a one-to-many relationship as an attribute of the "one" relation
  • Adding attributes to a relation from another relation with which it will be joined
  • Star schemas, which are also known as fact-dimension models and have been extended to snowflake schemas
  • Prebuilt summarization or OLAP cubes
  • Denormalization techniques are often used to improve the scalability of Web applications.]

    原文地址:

    Example: a shopping cart order

    Suppose that we are designing a schema for a shopping cart application. Our application

    stores orders in MongoDB, but what information should an order contain?

    Normalized schema

    A product: { : productId, : name, : price, : description } An order: { : orderId, : userInfo, : [ productId1, productId2, productId3 ] } ,美国服务器,美国空间,香港虚拟主机

    分享到:QQ空间新浪微博腾讯微博微信百度贴吧QQ好友复制网址打印

    您可能想查找下面的文章:

    • Normalization VS Denormalization [转]

    相关文章

    • 2018-12-05MySQL高级六——函数创建和使用
    • 2017-05-11有关mysql中ROW_COUNT()的小例子
    • 2018-12-05详解oracle数据库迁移到MySQL的方法总结(图文)
    • 2018-12-05简单触发器的使用 献给SQL初学者
    • 2018-12-05MySQL安全性指南(3)(转)
    • 2017-05-11MySQL插入数据时插入无效列的解决方法
    • 2018-12-05mysql中RAND()随便查询记录效率问题和解决办法分享
    • 2018-12-05pymysql 操作数据库
    • 2018-12-05MySQL5创建存储过程的示例
    • 2017-05-11找到MySQL的优点

    文章分类

    • MsSql
    • Mysql
    • oracle
    • MariaDB
    • DB2
    • SQLite
    • PostgreSQL
    • MongoDB
    • Redis
    • Access
    • 数据库其它
    • sybase
    • HBase

    最近更新的内容

      • MySQL 替换某字段内部分内容的UPDATE语句
      • MySQL 查找价格最高的图书经销商的几种SQL语句
      • Linux下MySQL5.1安装详解
      • mysql主从库不同步问题解决方法
      • MYSQL教程关于mysql5.7.18的安装和连接教程
      • 解析MySQL中mysqldump工具的基本用法
      • 存储过程的定义、修改和删除的操作方法
      • 重装系统后mysql怎么恢复
      • 服务器不支持 MySql 数据库的解决方法
      • SQLServer Job运行成功或失败时发送电子邮件通知的图文教程

    关于我们 - 联系我们 - 免责声明 - 网站地图

    ©2020-2025 All Rights Reserved. linkedu.com 版权所有