You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/10/25 06:57:48 UTC

[GitHub] [dolphinscheduler] caishunfeng commented on a diff in pull request #12506: [Improvement][BatchQuery] Batch query ProcessDefinitions belongs to need failover ProcessInstance.

caishunfeng commented on code in PR #12506:
URL: https://github.com/apache/dolphinscheduler/pull/12506#discussion_r1004075767


##########
dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ProcessDefinitionLogMapper.xml:
##########
@@ -50,6 +50,16 @@
         where code = #{code}
         and version = #{version}
     </select>
+    <select id="queryByDefinitionCodesAndVersion" resultType="org.apache.dolphinscheduler.dao.entity.ProcessDefinitionLog"
+            parameterType="org.apache.dolphinscheduler.dao.entity.ProcessInstance">
+        select
+        <include refid="baseSql"/>
+        from t_ds_process_definition_log
+        where
+        <foreach collection="processInstances" item="item" separator="or">

Review Comment:
   It should avoid the use `or` in query, because it will miss the index and query slowly.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org