You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add SqlFingerprint field to ExecuteSQL struct
- Update audit logic to store SQL fingerprint
- Use longtext type for SqlFingerprint to accommodate large values
- Index SqlFingerprint for efficient querying
func (s *Storage) createSqlManageRawSQLs(sqls []*SQLManageRawSQL) error {
+ if len(sqls) == 0 {+ return nil+ }+ if err := s.db.Create(&sqls).Error; err != nil {+ return err+ }
return nil
}
Suggestion importance[1-10]: 8
__
Why: The suggestion replaces the stubbed implementation of createSqlManageRawSQLs with actual database insertion logic using s.db.Create, which is critical for data persistence. This improvement addresses a significant functional issue.
Why: By handling errors from json.Marshal, the suggestion improves the robustness of the function ConvertSQLV2ToMangerRawSQL. This error handling change is important to avoid potential issues with incorrect or missing data processing.
Why: The suggestion correctly identifies the ignored error from json.Marshal and proposes proper error handling, improving the stability of the conversion. The improvement is relevant and accurately reflects the change needed in the ConvertSQLV2ToMangerRawSQL function.
Why: The suggestion improves reliability by properly handling the error from json.Marshal in the ConvertSQLV2ToMangerRawSQL function, reducing potential runtime issues.
Why: The suggestion introduces an error log when parsing sv.Value fails, which aids in debugging. However, it is a minor logging improvement rather than fixing a core bug.
Why: This suggestion adds a warning log for time parsing errors, offering better traceability for data issues. It is a useful improvement but not critical for functionality.
Why: The suggestion improves error visibility by adding a comment for logging when time.Parse fails, which is useful for debugging but represents a minor improvement.
sqls := make([]*SQLV2, 0, len(res))
for i := range res {
if at.filterFullProcessList(res[i], sqlMinSecond, db.Db.GetConnectionID()) {
continue
}
- ...+ // 注意:确认是否需要新增去重或聚合处理逻辑
sqls = append(sqls, sqlV2)
}
return sqls, nil
Suggestion importance[1-10]: 5
__
Why: The suggestion prompts a verification of the removed AggregateSQL logic to avoid data duplication or loss, but it only adds a clarifying comment without changing the actual functionality.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
关联的 issue
https://github.com/actiontech/sqle-ee/issues/2450
描述你的变更
性能洞察-关联SQL
功能查询使用性能洞察-关联SQL
功能查询使用性能洞察-关联SQL
功能查询具体单个SQL信息assign in @iwanghc
确认项(pr提交后操作)
Tip
请在指定复审人之前,确认并完成以下事项,完成后✅
not_compatible
need_update_doc
Description
添加GetInstances接口便于实例查询
新增系统变量及默认有效时长设置
新增SQLManageRawSQL结构体与创建、清理函数
更新ExecuteSQL结构体增加SqlFingerprint字段
Diagram Walkthrough
File Walkthrough