kimmking commented on issue #7809:
URL: https://github.com/apache/shardingsphere/issues/7809#issuecomment-709972707


   It seems isToAddDerivedLiteralExpression method will call 
getGroupedParameters for an empty check every time.
   So we can make two improvement choices:
   - cache the GroupedParameters for one sql and will called 5000 times in 
multiple values
   - add a new check empty method and avoid new/merge parameters
   
   ```
       private boolean isToAddDerivedLiteralExpression(final 
InsertStatementContext insertStatementContext, final int insertValueCount) {
           return 
insertStatementContext.getGroupedParameters().get(insertValueCount).isEmpty();
       }
   
       public List<List<Object>> getGroupedParameters() {
           List<List<Object>> result = new LinkedList<>();
           for (InsertValueContext each : insertValueContexts) {
               result.add(each.getParameters());
           }
           if (null != insertSelectContext) {
               result.add(insertSelectContext.getParameters());
           }
           return result;
       }
   ```
   


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