当前位置:网站首页>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 .
边栏推荐
- Technology cloud report: East to West computing is not only about "computing", but also needs "new storage"
- [ongoing update...] 2021 National Electronic Design Competition for college students (III) interpretation of the anonymous four axis space developer flight control system design
- Uniapp applet mall develops thinkphp6 points mall, group purchase and seckill packaged app
- General trend wisdom to create inclined model and cut monomer
- shell(34) : 時間
- 二级造价工程师考前必备15个知识点来了!祝你旗开得胜!
- Las point cloud data thinning in ArcGIS
- 自助圖書館系統-Tkinter界面和openpyxl錶格綜合設計案例
- June 25 PMI certification examination site epidemic prevention requirements and examination room arrangement
- Redis-分布式锁
猜你喜欢

Kdd'22 | Ali: fine tuning CTR estimation based on EE exploration
![[geometric vision] 4.2 piecewise linear transformation](/img/1e/a810f4d7e9a6a34647b5cb56fdde67.png)
[geometric vision] 4.2 piecewise linear transformation
Mysql8 installation and environment configuration

In a frame because it set 'X-FRAME-OPTIONS' to' deny '
![[interpretation of the paper] sort out the papers on the vision based autonomous landing platform of UAV](/img/a5/bfa011c961b8f05348f9905fe3d996.png)
[interpretation of the paper] sort out the papers on the vision based autonomous landing platform of UAV

Système de bibliothèque libre - service - cas de conception complète de l'interface tkinter et du formulaire openpyxl
![[GWCTF 2019]mypassword XSS](/img/26/3611fd5aae21ea004dcfcc2c623328.png)
[GWCTF 2019]mypassword XSS

Dragon City in Europe | National Geographic the most romantic and safe destination in the world

Implementation of depth traversal adjacency table in Figure 6-7

6-3 non recursive traversal of binary tree
随机推荐
Delphi SOAP WebService 服务器端多个 SoapDataModule 要注意的问题
Why is yuancosmos so popular? Is the 10trillion yuan shouted by the market boasting or the truth?
Dynamic tree + data table + pagination of spa project development
SPA项目开发之动态树+数据表格+分页
How to carry out encryption protection for equipment under extortion virus rampant
Is it bad for NFT that the market starts to cool down?
Shell (34): Time
【论文解读】关于基于视觉无人机自主降落平台的论文梳理
CYCA少儿形体礼仪 深圳市培训成果考核圆满落幕
British teddy bear joins the pubg mobile game
[path planning] week 1: hodgepodge
Why do you perform performance tests before the software goes online? How to find a software performance testing organization
【路径规划】第一周: 大杂烩
CSV add a new column
【象棋人生】01 人生如棋
[chess life] 01 life is like chess
The required reading for candidates | PMP the test on June 25 is approaching. What should we pay attention to?
大不列颠泰迪熊加入PUBG 手游
【路径规划】第一周: 路径规划 开源代码汇总(ROS) 版本
【ROS 入门学习 】CmakeList.txt 和Packages.xml释义