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.

  • 相关阅读:
    单体架构还是微服务架构,这是个问题?
    ASP.NET 5中的ASP.NET Bundles跑到哪里去了?
    如何在ASP.NET MVC和EF中使用AngularJS
    在VS 2015中边调试边分析性能
    C#中的Infinity有个小坑
    利用Roslyn构建一个简单的C#交互脚本引擎
    移动端跨平台开发干货分享
    在ASP.NET 5中读取配置文件
    5个让你的SaaS应用大卖的技巧
    大数据技术之_19_Spark学习_08_Spark 机器学习_01_机器学习概述 + 机器学习的相关概念 + 算法常用指标
  • 原文地址:https://www.cnblogs.com/sthv/p/5752299.html
Copyright © 2011-2022 走看看