当前位置:网站首页>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 .
边栏推荐
- Is it bad for NFT that the market starts to cool down?
- A case of 94 SQL optimization (the writing method used is often rejected)
- Total number of combinations [standard backtracking + backtracking techniques -- reducing stack depth]
- [geometric vision] 4.2 piecewise linear transformation
- Mysql database DQL exercise
- Task cache compilation caused by gradle build cache
- [Li mu] how to read papers [intensive reading of papers]
- 【知乎知识主推荐】 无人机中的城堡- 专注于无人机在不同技术领域的应用
- [GWCTF 2019]mypassword XSS
- 6-1 operation set of binary search tree
猜你喜欢

Why do you perform performance tests before the software goes online? How to find a software performance testing organization

Is it bad for NFT that the market starts to cool down?

Liunx installing MySQL

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

Seriously, the hang up of the kotlin collaboration process is not so mysterious (principle)

SPA项目开发之登录注册
![[ongoing update...] 2021 National Electronic Design Competition for college students (III) interpretation of the anonymous four axis space developer flight control system design](/img/5d/71c75a3622f7814f385d04b6148074.png)
[ongoing update...] 2021 National Electronic Design Competition for college students (III) interpretation of the anonymous four axis space developer flight control system design

Système de bibliothèque libre - service - cas de conception complète de l'interface tkinter et du formulaire openpyxl
![[ROS introduction] cmakelist Txt and packages XML interpretation](/img/37/24ce4be244ea56c2c84342492fccd4.png)
[ROS introduction] cmakelist Txt and packages XML interpretation

Dragon City in Europe | National Geographic the most romantic and safe destination in the world
随机推荐
MySQL functions
下一个排列[发挥主观能动性发现规律]
Reasons for the failure of digital transformation and the way to success
组合总数[标准回溯 + 回溯技巧--降低栈深度]
Liunx installing MySQL
Rendu stéréo
Vs code one key sorting shortcut
[GWCTF 2019]mypassword XSS
Atcoder abc256 full problem solution (interval merging template, matrix fast power optimization DP, line segment tree...)
A hundred lines of code to realize reliable delay queue based on redis
Shell (34): time
Mysql database DQL exercise
Self service library system Tkinter interface and openpyxl form comprehensive design case
[path planning] week 1: hodgepodge
Cryptography series: certificate format representation of PKI X.509
In the middle of the year, we will promote the integration of worry free, and the value-added package will be reduced by 6
Why do you perform performance tests before the software goes online? How to find a software performance testing organization
There are 15 necessary knowledge points for the second level cost engineer before the exam! I wish you success!
腾讯云上传文件出现的问题:in a frame because it set ‘X-Frame-Options‘ to ‘deny‘.
注意|24日截止 2022年广东二级造价工程师准考证打印入口开通