zoukankan      html  css  js  c++  java
  • 复制Informational constraints on LUW DB2 v105

    An informational constraint is a constraint attribute that can be used by the SQL compiler to improve the access to data. Informational constraints are not enforced by the database manager, and are not used for additional verification of data; rather, they are used to improve query performance.

    You define informational constraints by using the CREATE TABLE or ALTER TABLE statement. You first add constraints and then associate them with constraint attributes, specifying whether the database manager is to enforce the constraints. For primary key constraints, unique constraints, and check constraints, you can further specify that the constraint can be trusted. For referential integrity constraints, if the constraint is not enforced, you can further specify whether the constraint can be trusted. A not-enforced and not-trusted constraint is also known as a statistical referential integrity constraint. You can specify whether a referential integrity constraint or check constraint is to be used for query optimization.

    Informational RI (referential integrity) constraints are used to optimize query performance, the incremental processing of REFRESH IMMEDIATE MQT, and staging tables. Query results, MQT data, and staging tables might be incorrect if informational constraints are violated.

    For example, the order in which parent-child tables are maintained is important. When you want to add rows to a parent-child table, you must insert rows into the parent table first. To remove rows from a parent-child table, you must delete rows from the child table first. This ensures that there are no orphan rows in the child table at any time. Otherwise the informational constraint violation might affect the correctness of queries being executed during table maintenance, as well as the correctness of the incremental maintenance of dependent MQT data and staging tables.

    You can create a not-enforced primary key or unique constraint for either a column-organized or row-organized table. Unlike an enforced primary key or unique constraint, a not-enforced primary key or unique constraint does not create an index on the data. Specify an informational constraint only if the table data is independently known to conform to the constraint. Because the DB2® database manager does not enforce uniqueness for these constraints, if the table data violates the not-enforced constraint, incorrect results can occur. You cannot reference not-enforced primary key constraints in any enforced referential integrity definitions.

  • 相关阅读:
    Windows Server 无法启用 .Net Framework3.5的问题
    DocumentSet 操作代码(二)
    自定义SharePoint2010文档库的上传页面
    SharePoint2010 文档集操作创建
    JQuery 删除SharePoint菜单
    three.js项目引入vue,因代码编写不当导致的严重影响性能的问题,卡顿掉帧严重
    WPF 实现窗体鼠标事件穿透
    如何在传统前端项目中进行javascript模块化编程,并引入使用vue.js、elementui,并且不依赖nodejs和webpack?
    用 three.js 绘制三维带箭头线 (线内箭头)
    Vista中给IIS7添加PHP支持终于算是做成了
  • 原文地址:https://www.cnblogs.com/sthv/p/5752299.html
Copyright © 2011-2022 走看看