oracle 优化器模式 optimizer_mode

2024-07-29 14:48 栏目: 公司新闻 查看()

os: centos 7.4
db: oracle 11.2.0.4

 
 

默认值为 all_rows

 

optimizer_mode 有几种枚举值呢?

在这里插入图片描述
first_rows_n

The optimizer uses a cost-based approach and optimizes with a goal of best response time to return the first n rows (where n = 1, 10, 100, 1000).

first_rows

The optimizer uses a mix of costs and heuristics to find a best plan for fast delivery of the first few rows.

all_rows

The optimizer uses a cost-based approach for all SQL statements in the session and optimizes with a goal of best throughput (minimum resource use to complete the entire statement).

在 session 级别修改试试看

 

以上都设置成功,如果那个 n 为别的数字了?可以看到报错了

 
 
 

另外有个 first_rows(n) 的hint,这个 n 是可以为其余数字的,如下:

 

参考:
https://docs.oracle.com/cd/E11882_01/server.112/e40402/initparams171.htm#REFRN10145
https://docs.oracle.com/cd/E11882_01/server.112/e41573/optimops.htm#i38217

扫二维码与项目经理沟通

我们在微信上24小时期待你的声音

解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流

郑重申明:某某网络以外的任何单位或个人,不得使用该案例作为工作成功展示!

平台注册入口