yangyichao-mango commented on a change in pull request #3184:
URL: 
https://github.com/apache/incubator-dolphinscheduler/pull/3184#discussion_r453151529



##########
File path: 
dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ProcessInstanceMapper.xml
##########
@@ -37,6 +37,16 @@
         order by id asc
     </select>
 
+    <select id="queryTopNProcessInstance" 
resultType="org.apache.dolphinscheduler.dao.entity.ProcessInstance">
+        select *
+        from t_ds_process_instance
+        where state = 7
+        and start_time between
+        #{startTime} and #{endTime}
+        order by end_time-start_time desc
+        limit #{size}
+    </select>

Review comment:
       ```suggestion
       <select id="queryTopNProcessInstance" 
resultType="org.apache.dolphinscheduler.dao.entity.ProcessInstance">
           select *
           from `t_ds_process_instance`
           where `state` = #{state}
           and `start_time` between
           #{startTime} and #{endTime}
           order by `end_time` - `start_time` desc
           limit #{size}
       </select>
   ```
   
   Hi,
   
   Good job, is it better to pass the `state` as a parameter to avoid the value 
change of state.
   Thx a lot.




----------------------------------------------------------------
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.

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


Reply via email to