0x-infinity opened a new issue, #1017:
URL: https://github.com/apache/incubator-seata-go/issues/1017

   ### 讨论详情
   
   ## Description
   The current implementation of `BaseExecutor.parsePkValues` uses a very 
brute-force three nested for loops, and its time complexity needs to be 
optimized.
   
   ```go
   func (b *BaseExecutor) parsePkValues(rows []types.RowImage, pkNameList 
[]string) map[string][]types.ColumnImage {
        pkValues := make(map[string][]types.ColumnImage)
        // todo optimize 3 fors
        for _, row := range rows {
                for _, column := range row.Columns {
                        for _, pk := range pkNameList {
                                if strings.EqualFold(pk, column.ColumnName) {
                                        values := pkValues[strings.ToUpper(pk)]
                                        if values == nil {
                                                values = 
make([]types.ColumnImage, 0)
                                        }
                                        values = append(values, column)
                                        pkValues[pk] = values
                                }
                        }
                }
        }
        return pkValues
   }
   ```
   
   ### 📚 相关背景
   
   _No response_


-- 
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: [email protected]

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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to