CalvinKirs opened a new issue #5061:
URL: https://github.com/apache/incubator-dolphinscheduler/issues/5061


   We should write SQL more granularly, eg, some queries only need to return 
true or false, but for general purpose, the actual sql statement we write is 
like this,
   ```
      select *
            from t_ds_datasource
            where name=#{name}
   ```
   
   A lot of unnecessary fields were queried, and at the same time, there was no 
paging.
   
   This is a real business application
   ```
   List<DataSource> dataSources = 
dataSourceMapper.queryDataSourceByName(sqlParameters.getString("datasourceName"));
            if (!dataSources.isEmpty()) {
                DataSource dataSource = dataSources.get(0);
                sqlParameters.put("datasource", dataSource.getId());
            }
   ```
   
   Of course there are advantages to doing so, but at the same time it also 
brings many disadvantages, such as what I mentioned above, besides. In most 
cases, select needs to add a limit limit (maybe the current situation will not 
be a problem, but the disaster often does not happen in the present).


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