In addition to Weibo, there is also WeChat
Please pay attention

WeChat public account
Shulou
2025-12-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Customers often mention that the execution plan of a SQL has deteriorated, resulting in performance problems, and then ask why the new
Carry out the plan. First of all, it is certain that the sudden emergence of a new implementation plan indicates that sql has reparsed hard (note that hard parsing may not be necessary.
Generate a new execution plan), so why does a good sql need to be reparsed? Today we will list a few common reasons:
1. Automatically collect statistics
In order to ensure the best execution performance of sql, oracle needs to find an optimal execution plan, and the optimizer based on CBO pattern must
To know the latest statistics, such as the number of entries, the number of block, the selection rate of a field, etc., so oracle will run a
A job that automatically collects statistics to collect the latest statistics for tables that have changed by more than 10%. When the collection is complete, of course
To use the new sql, you need to do hard parsing. By default, oracle will not invalid immediately after collecting certain table statistics.
All related cursor, because this is too violent, will cause hard parsing related performance problems, so cleverly designed, when a related sql execution found that a dependent object recently collected statistics, it will randomly type a timestamp, the timestamp is
There is a timestamp within 5 hours. If this timestamp is found in the next sql parsing, it will be compared with the current time. If it is exceeded, hard parsing will be performed immediately, otherwise soft parsing will continue.
two。 There is no qualified child cursor such as bind mismatch (for other reasons, please refer to v$sql_shared_cursor)
When a sql uses a binding variable, ORACLE records the metadata associated with the binding variable when the cursor first hard parses it
It will be checked when it is parsed later, and will be re-parsed if it is found that the type or length of the bound variable does not match. Let's use a small example to verify it:
CREATE TABLE MAOB_T AS SELECT FROM DBA_TABlES
VAR B1 char (20)
EXEC: B1: = 'MAOB'
SELECT COUNT () FROM MAOB_T WHERE TABLE_NAME=:B1
Check the cursor situation
Select sql_id,child_number,first_load_time from V$SQL WHERE SQL_TEXT LIKE'% COUNT%MAOB_T%'
4v22rgk83gjnc 0 2017-12-15 Compact 22 purl 52purl 46
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope





About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.