RELY constraints
数据仓库中的数据,一般是通过ETL定期load进来的。在做ETL的时候,一般会对load的数据的一致性做检查。所以,我们有理由认为,数据仓库中的数据都是符合一致性要求的。那么,在数据仓库中的表上还有必要加constraint么?
既然我们已经可以确定数据仓库中的数据是一致的,那么应该就没有必要再在表上建constraint了,constraint对DML或者load操作是有性能影响的,能不用当然不用的好。但是,虽然表中的数据实际上一致了,oracle自己却不知道,优化器也不知道。在查询重写(query rewrite)时,很多时候需要知道数据之间的约束,而在数据仓库中,查询重写对性能的影响相当大。
为了告诉oracle,数据应该符合某种一致性条件了,而又不想创建的constraint其作用,就可以创建类型为RELY的constraint,也就是一种可以让oracle知道这些数据是符合这些约束的,但这个约束本身却是没有其实际作用的约束。
文档中给出了一个例子:
ALTER TABLE sales ADD CONSTRAINT sales_time_fk
FOREIGN KEY (time_id) REFERENCES times (time_id)
RELY DISABLE NOVALIDATE;
可以看到这个constraint的状态是disable novalidate的,也就是它实际上是不起约束作用的,只是告诉oracle优化器,这里的数据是符合这么一个约束条件的。
另外,在视图上也是可以建constrain的,不过只能是RELY constraint
RELY constraints相关推荐
- Oracle 19c 新特性 —— 混合分区表Hybrid partitioned tables
简介 从19c开始,Oracle数据库支持Hybrid partitioned tables,也就是混合分区表,进一步扩展了Oracle分区技术.这里的混合指的是数据的分布,分区表的分区可以一些位于数 ...
- rely constraint
Stuck in a rut. I'm on constraints this week. It all started with "something about nothing" ...
- Derivative finite-differencing step was artificially reduced to be within bound constraints.
警告: Derivative finite-differencing step was artificially reduced to be within bound constraints. Thi ...
- It is not safe to rely on the system's timezone settings
在写php程序中有时会出现这样的警告: PHP Warning: date(): It is not safe to rely on the system's timezone settings. Y ...
- R语言构建xgboost模型:指定特征交互方式、单调性约束的特征、获取模型中的最终特征交互形式(interaction and monotonicity constraints)
R语言构建xgboost模型:指定特征交互方式.单调性约束的特征.获取模型中的最终特征交互形式(interaction and monotonicity constraints) 目录
- PHP date()函数警告: It is not safe to rely on the system解决方法
访问网站提示: date(): It is not safe to rely on the system's timezone settings. You are *required* to use ...
- Warning:date():It is not safe to rely on the syste
2019独角兽企业重金招聘Python工程师标准>>> Warning:date():It is not safe to rely on the system's timezone ...
- Advanced Auto Layout:Programmatically Creating Constraints
Programmatically Creating Constraints以编程方式创建约束 Whenever possible, use Interface Builder to set your ...
- 解决eclipse+MAVEN提示One or more constraints have not been satisfied.的问题
解决eclipse+MAVEN提示One or more constraints have not been satisfied.的问题 参考文章: (1)解决eclipse+MAVEN提示One o ...
最新文章
- 通知 | 2021年度“RONG”奖学金入围答辩名单公布
- 维基百科用php,在PHP中解析维基百科标记的最佳方法是什么?
- 阿里云服务器被挖矿病毒minerd***的解决方法
- TensorFlow2.0(八)--tf.function函数转换
- 挣钱难,做老板不易,特别是种植老板
- 用python绘制心形_如何利用Python绘制一个爱心
- 梦网云通讯平台单条短信发送接口single_send说明
- excel教程自学网_超实用!良心推荐15个神级自学网站,内容全面质量又高
- SAP PI PO XSLT Mapping of Adapter-Specific Message Attributes
- Python基础综合
- 别踩白块游戏用html如何制作,纯用JavaScript 实现网页上《别踩白块儿》小游戏
- 典型相关性分析(清风建模学习笔记)
- C#:命名空间“System.Windows”中不存在类型或命名空间名“Forms”(是否缺少程序集引用?)
- 洛谷P1195 口袋的天空
- 健康生活每日“8禁忌”
- qs计算机专业排名2017,2017qs世界大学学科专业排名top10完整版
- Windows 工具栏ToolBar
- 2018 codeM 初赛A卷 第二题 棋盘题 -java
- Java、JSP美食网站的设计与实现
- LabVIEW TDMS文件的批量读取与转存Excel