mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-31 15:06:26 +00:00
wip
This commit is contained in:
parent
ccb4031e62
commit
cb42a1a6fc
1 changed files with 27 additions and 1 deletions
|
@ -737,6 +737,18 @@ func (sfup *statsFuncUniqProcessor) updateStatsForAllRows(timestamps []int64, co
|
|||
// Count unique rows
|
||||
keyBuf := sfup.keyBuf
|
||||
for i := range timestamps {
|
||||
seenKey := true
|
||||
for _, c := range columns {
|
||||
values := c.Values
|
||||
if i == 0 || values[i-1] != values[i] {
|
||||
seenKey = false
|
||||
break
|
||||
}
|
||||
}
|
||||
if seenKey {
|
||||
continue
|
||||
}
|
||||
|
||||
allEmptyValues := true
|
||||
keyBuf = keyBuf[:0]
|
||||
for _, c := range columns {
|
||||
|
@ -763,11 +775,15 @@ func (sfup *statsFuncUniqProcessor) updateStatsForAllRows(timestamps []int64, co
|
|||
if len(fields) == 1 {
|
||||
// Fast path for a single column
|
||||
if idx := getBlockColumnIndex(columns, fields[0]); idx >= 0 {
|
||||
for _, v := range columns[idx].Values {
|
||||
values := columns[idx].Values
|
||||
for i, v := range values {
|
||||
if v == "" {
|
||||
// Do not count empty values
|
||||
continue
|
||||
}
|
||||
if i > 0 && values[i-1] == v {
|
||||
continue
|
||||
}
|
||||
if _, ok := m[v]; !ok {
|
||||
vCopy := strings.Clone(v)
|
||||
m[vCopy] = struct{}{}
|
||||
|
@ -786,6 +802,16 @@ func (sfup *statsFuncUniqProcessor) updateStatsForAllRows(timestamps []int64, co
|
|||
|
||||
keyBuf := sfup.keyBuf
|
||||
for i := range timestamps {
|
||||
seenKey := true
|
||||
for _, values := range columnValues {
|
||||
if i == 0 || values[i-1] != values[i] {
|
||||
seenKey = false
|
||||
}
|
||||
}
|
||||
if seenKey {
|
||||
continue
|
||||
}
|
||||
|
||||
allEmptyValues := true
|
||||
keyBuf = keyBuf[:0]
|
||||
for _, values := range columnValues {
|
||||
|
|
Loading…
Reference in a new issue