1996fanrui commented on code in PR #865: URL: https://github.com/apache/flink-kubernetes-operator/pull/865#discussion_r1724509994
########## flink-autoscaler-plugin-jdbc/src/main/java/org/apache/flink/autoscaler/jdbc/event/JdbcEventInteractor.java: ########## @@ -160,9 +160,9 @@ ExpiredEventsResult queryExpiredEventsAndMaxId(Duration eventHandlerTtl) throws var query = "SELECT min(id) min_id, max(id) max_id " + "FROM t_flink_autoscaler_event_handler " - + "WHERE create_time < ? AND id < (" + + "WHERE create_time < ? AND id <= (" + " SELECT id FROM t_flink_autoscaler_event_handler " - + " WHERE create_time >= ? ORDER BY id ASC LIMIT 1)"; + + " WHERE create_time < ? ORDER BY id DESC LIMIT 1)"; Review Comment: As I understand, desc will scan most of data. -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org