SbloodyS commented on code in PR #15003:
URL: 
https://github.com/apache/dolphinscheduler/pull/15003#discussion_r1356483760


##########
dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/TaskDefinitionMapper.xml:
##########
@@ -170,4 +170,24 @@
         </where>
         order by update_time desc, id asc
     </select>
+
+    <select id="queryAllTaskDefinitionByWorkFlowReleaseStateAndTaskFlag" 
resultType="org.apache.dolphinscheduler.dao.entity.TaskDefinition">
+        SELECT
+        <include refid="baseSqlV2">
+            <property name="alias" value="td"/>
+        </include>
+        FROM t_ds_process_definition as pd
+        JOIN t_ds_process_task_relation as ptr on pd.code = 
ptr.process_definition_code and pd.version = ptr.process_definition_version
+        JOIN t_ds_task_definition as td on ptr.post_task_code = td.code and 
ptr.post_task_version = td.version
+        <where>
+            <if test="releaseState != null">
+                and pd.release_state = #{releaseState}
+            </if>
+            <if test="taskFlag != null">
+                and td.flag = #{taskFlag}
+            </if>
+        </where>

Review Comment:
   This can lead to serious performance accidents in production environments 
with large amounts of data. We should not do this way... cc @zhuangchong 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to