你看你的top sql里全是動態采樣的sql,默認10g以后optimizer_dynamic_sampling參數為level 2,一般為缺失統計信息會造成每次使用動態采樣,雖然動態采樣會在表頻繁發生大批量改變時,一般可以生成更好的執行計劃,但是也不往往是這樣,所以看看 “ASSP2”."ASSP_CLOB_VOUCHER_STAMP_2020"表為什么相關SQL都走動態采樣?
下面為該參數級別解釋Mos(Doc ID 336267.1):
The parameter OPTIMIZER_DYNAMIC_SAMPLING controls the level of sampling performed by the optimizer.
In simplified form, the Levels have the following effects:
Level 0: Disables dynamic sampling.
Level 1: Sample all tables that have not been analyzed that meet certain criteria.
Level 2: Apply dynamic sampling to all unanalyzed tables. (Default from 10g)
Level 3: As per Level 2, plus all tables for which standard selectivity estimates used a guess for some predicate that is a potential dynamic sampling predicate.
Level 4: As per Level 3, plus all tables that have complex predicate expressions (for example single-table predicates that reference 2 or more columns or non-equality where clause predicates on two correlated columns).
Level 5-9: As per Level 4 with a larger sample size each time.
Level 10: Use dynamic sampling for all statements sampling All blocks