**Describe the question** As report by #5061, we need to optimize the sql. What are the current deficiencies and the benefits of improvement Improve the performance about check some exist with cleaner method **Which version of DolphinScheduler:** -[dev]