Merge pull request #13056 from songjiayang/symbolCacheEntry-filed-alignment

TSDB block index writer: reduce memory used by symbol cache

Improve struct field alignment for symbolCacheEntry
This commit is contained in:
Bryan Boreham 2023-11-13 14:37:43 +00:00 committed by GitHub
commit 37573d083b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -107,8 +107,8 @@ func newCRC32() hash.Hash32 {
type symbolCacheEntry struct {
index uint32
lastValue string
lastValueIndex uint32
lastValue string
}
// Writer implements the IndexWriter interface for the standard
@ -457,8 +457,8 @@ func (w *Writer) AddSeries(ref storage.SeriesRef, lset labels.Labels, chunks ...
}
w.symbolCache[l.Name] = symbolCacheEntry{
index: nameIndex,
lastValue: l.Value,
lastValueIndex: valueIndex,
lastValue: l.Value,
}
}
w.buf2.PutUvarint32(valueIndex)