Skip to content

Commit

Permalink
Merge pull request #2903 from actiontech/add_oracle_rule_performance_…
Browse files Browse the repository at this point in the history
…cost

add oracle rule performance cost map
  • Loading branch information
iwanghc authored Jan 24, 2025
2 parents 02809c4 + a7d1a68 commit 918b895
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions sqle/model/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -697,12 +697,26 @@ func (s *Storage) UpdateRuleCategoryRels(rule *Rule) error {
return err
}

// TODO : 避免直接用规则名称映射
var ruleNameToPerformanceCostId = map[string] /*ruleId*/ string /*auditPerformanceLevelCategorieID*/ {
// old rule: MySQL
rule.DMLCheckSelectRows: plocale.RuleTagPerformanceCostHigh.ID,
rule.DMLCheckAffectedRows: plocale.RuleTagPerformanceCostHigh.ID,
rule.ConfigOptimizeIndexEnabled: plocale.RuleTagPerformanceCostHigh.ID,
rule.DDLCheckIndexOption: plocale.RuleTagPerformanceCostHigh.ID,
rule.DDLCheckCompositeIndexDistinction: plocale.RuleTagPerformanceCostHigh.ID,

// new rule: Oracle
"Oracle_011": plocale.RuleTagPerformanceCostHigh.ID,
"Oracle_012": plocale.RuleTagPerformanceCostHigh.ID,
"Oracle_017": plocale.RuleTagPerformanceCostHigh.ID,
"Oracle_019": plocale.RuleTagPerformanceCostHigh.ID,
"Oracle_044": plocale.RuleTagPerformanceCostHigh.ID,
"Oracle_046": plocale.RuleTagPerformanceCostHigh.ID,
"Oracle_050": plocale.RuleTagPerformanceCostHigh.ID,
"Oracle_077": plocale.RuleTagPerformanceCostHigh.ID,
"Oracle_078": plocale.RuleTagPerformanceCostHigh.ID,
"Oracle_080": plocale.RuleTagPerformanceCostHigh.ID,
}

func (s *Storage) GetDefaultRuleTemplateName(dbType string) string {
Expand Down

0 comments on commit 918b895

Please sign in to comment.