You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by "0x-infinity (via GitHub)" <gi...@apache.org> on 2025/12/05 17:02:28 UTC
[I] Optimize `BaseExecutor.parsePkValues` [incubator-seata-go]
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: notifications-unsubscribe@seata.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] Optimize `BaseExecutor.parsePkValues` [incubator-seata-go]
Posted by "everfid-ever (via GitHub)" <gi...@apache.org>.
everfid-ever commented on issue #1017:
URL: https://github.com/apache/incubator-seata-go/issues/1017#issuecomment-3618229699
please assign to me
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org