调整join后的 card OPT_ESTIMATE cardinality 配置起来优化更顺手

create_extended_stats的创建及 cardinality opt_estimate相互影响-CSDN博客icon-default.png?t=O83Ahttps://blog.csdn.net/jnrjian/article/details/142438401?sharetype=blogdetail&sharerId=142438401&sharerefer=PC&sharesource=jnrjian&spm=1011.2480.3001.8118

OPT_ESTIMATE cardinality 这两个都可以控制执行计划,不是说OPT_ESTIMATE 只能在估计的结果集上进行操作,这个操作的结果也可以返回来影响执行计划。

GOAL

Goal of the document is to show how an optimizer hint can be used in a SQL statement to specify the cardinality (no.of rows) for a join operation.
Generally, CARDINALITY hint is used to specify the no.of rows for a table and not for join.

SOLUTION

OPT_ESTIMATE hint can be used to specify the cardinality (no.of rows) for the join operations as well.

Syntax:

OPT_ESTIMATE(join, (alias1,alias2), rows=n) => To specify the no.of rows for join operation
OPT_ESTIMATE(join, (alias1,alias2), scale_rows=n) => To increase or decrease (scale up/down) the n

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值