扫二维码与项目经理沟通
我们在微信上24小时期待你的声音
解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流
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小时期待你的声音
解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流