-
Notifications
You must be signed in to change notification settings - Fork 8.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
optimize: using subqueries to reduce the retrieval of invalid content data. #7184
base: 2.x
Are you sure you want to change the base?
Conversation
@@ -62,6 +62,10 @@ public String getQueryStateMachinesByNameAndTenantSql(String dbType) { | |||
return queryStateMachinesByNameAndTenantSql; | |||
} | |||
|
|||
public String getLastVersionStateMachine(String dbType) { | |||
return getQueryStateMachinesByNameAndTenantSql(dbType) + " LIMIT 1"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The LIMIT syntax is not part of the SQL standard, and there are several databases that do not support the LIMIT syntax.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The LIMIT syntax is not part of the SQL standard, and there are several databases that do not support the LIMIT syntax.
OK, I will optimize it.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 2.x #7184 +/- ##
============================================
+ Coverage 54.17% 54.18% +0.01%
- Complexity 7222 7223 +1
============================================
Files 1173 1173
Lines 41796 41796
Branches 4906 4906
============================================
+ Hits 22642 22647 +5
+ Misses 17013 17007 -6
- Partials 2141 2142 +1 🚀 New features to boost your workflow:
|
@@ -50,8 +50,12 @@ public StateMachine getStateMachineById(String stateMachineId) { | |||
|
|||
@Override | |||
public StateMachine getLastVersionStateMachine(String stateMachineName, String tenantId) { | |||
return selectOne(stateLangStoreSqls.getLastVersionStateMachine(dbType), RESULT_SET_TO_STATE_MACHINE, | |||
stateMachineName, tenantId); | |||
List<StateMachine> list = selectList(stateLangStoreSqls.getLastVersionStateMachine(dbType), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has this change been fully tested by saga? I remember that tenant_id is an optional field, what happens if the upper layer doesn't pass the tenant_id parameter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has this change been fully tested by saga? I remember that tenant_id is an optional field, what happens if the upper layer doesn't pass the tenant_id parameter?
I've performed local testing and executed the Saga test approach. When the tenant_id parameter is not provided, the system will automatically fill it with the defaultTenantId (000001).
Ⅰ. Describe what this PR did
Ⅱ. Does this pull request fix one issue?
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews