当前位置:网站首页>Talk about SQL profile again: can I fix the execution plan?
Talk about SQL profile again: can I fix the execution plan?
2022-06-22 22:38:00 【Tiger Liu】
After I released the use of coe_load_sql_profile.sql The script can solve the problem that the execution plan of the production system suddenly deteriorates , I happened to see another article the next day :《 Implementation plan :Oracle Of Profile Characteristics and SQL Stability of execution plan 》, The article is dedicated to sql profile Made an in-depth introduction , To understand SQL profile The principle of is very helpful . Because both the writer and the forwarder are big winners in the industry , Many fans , Many people should have read that article , Therefore, it is necessary to correct a minor flaw in the article , namely “SQL profile The execution plan cannot be fixed ” This conclusion is not accurate , Just a result under certain test conditions .
The following figure is the conclusion of the article :
Used by the author of the article Test case in , It should be possible to get such a result , But the conclusion is not complete , Will give the reader a misleading :SQL prfofile The execution plan cannot be fixed .
The above conclusion is that oracle Of sql tuning advisor Tool generated sql profile( Write only one opt_estimate One of them is hint), As an optimization tool , For such a SQL It is understandable not to be completely fixed . This also reminds us of DBA, use sql tuning advisor It's done sql profile It may not be able to execute the plan regularly .
I would like to add that : If in sql profile The complete outline data, The plan can be executed in a fixed way , For example, the following one SQL complete Hint Write the contents of profile:
/*+
BEGIN_OUTLINE_DATA
IGNORE_OPTIM_EMBEDDED_HINTS
OPTIMIZER_FEATURES_ENABLE('11.2.0.3')
DB_VERSION('11.2.0.3')
ALL_ROWS
OUTLINE_LEAF(@"SEL$1")
FULL(@"SEL
INDEX(@"SEL
LEADING(@"SEL
USE_NL(@"SEL
NLJ_BATCHING(@"SEL
END_OUTLINE_DATA
*/
This profile Yes you can specify SQL Which index to use , The association mode and order of tables .
Conclusion :
sql profile Can it be fixed sql Implementation plan of ?
The answer depends on where you are profile Used in hint What is the combination . Use the complete outline data The content can be fixed ; Use incomplete , Enlightening hint, Will not be fixed .
Use coe_sql_load_profile.sql The script will fix your SQL Implementation plan of ( Because it writes profile One of the contents of sql complete outline data Execution plan execution path ), Unless there's something special , If the index is not available 、 Insufficient parallel resources 、 Database related parameter changes, etc .
边栏推荐
- Based on AI driven macromolecular drug discovery, "Huashen Zhiyao" obtained nearly 500million yuan of round a financing
- Do not know how to choose the development of digital currency wallet?
- 6-3 non recursive traversal of binary tree
- Total number of combinations [standard backtracking + backtracking techniques -- reducing stack depth]
- SPA项目开发之CRUD+表单验证
- A hundred lines of code to realize reliable delay queue based on redis
- [GWCTF 2019]mypassword XSS
- [chess life] 01 life is like chess
- Why do you perform performance tests before the software goes online? How to find a software performance testing organization
- CSV add a new column
猜你喜欢

NFT can only be viewed from afar, but not blatantly played

Adblock blocks Baidu hot search

LinkedList 源码解析

Redis error reporting and common configurations

注意|24日截止 2022年广东二级造价工程师准考证打印入口开通

RapidEye快鸟、SPOT卫星遥感影像数据

Las point cloud create mesh

pycharm 配置远程连接服务器开发环境

Grafana report display of sentinel based high availability current limiting system

Reasons for the failure of digital transformation and the way to success
随机推荐
Plan and change of continuous repair
The required reading for candidates | PMP the test on June 25 is approaching. What should we pay attention to?
Redis distributed lock
Cryptography series: certificate format representation of PKI X.509
v-if和v-for哪个优先级更高?
Liunx installing MySQL
How to use the data dictionary function in the low code platform of the Internet of things?
322.零钱兑换
[ROS introduction] cmakelist Txt and packages XML interpretation
Uninstall mavros
Based on AI driven macromolecular drug discovery, "Huashen Zhiyao" obtained nearly 500million yuan of round a financing
Task management of embedded development foundation (thread management)
The link added in the bottom menu cannot jump to the secondary page
【MAVROS】MAVROS 啓動指南
Cvpr2022 𞓜 Heidelberg University's course "deep visual similarity and measurement learning"
Implementation of depth traversal adjacency table in Figure 6-7
Several ways of redis persistence -- deeply parsing RDB
[database] SQL Server quickly creates tables to simulate departments, courses, teachers, students and scores
【持续更新中...】2021年全国大学生电子设计大赛 (三)匿名四轴拓空者飞控系统设计解读
SPA项目开发之登录注册