-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Store total key-value size in table footer #1137
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 7 of 7 files at r1.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @ashish-goswami and @jarifibrahim)
table/builder.go, line 132 at r1 (raw file):
v.EncodeTo(b.buf) b.tableIndex.KvSize += uint64(uint32(headerSize) + uint32(len(diffKey)) + v.EncodedSize())
EstimatedSize
- Size of KV on SST
- Size of KV on Value Log
- Sum these two.
- Do not consider compression / encryption.
Or, perhaps do consider compression. Use the compressed size of the block and add the value log sizes to it.
table/table.go, line 445 at r1 (raw file):
// TotalKVSize returns the total size of key-values stored in this table. func (t *Table) TotalKVSize() uint64 { return t.kvSize }
EstimatedSize
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 11 of 11 files at r2.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @ashish-goswami and @jarifibrahim)
This PR stores the total key-value size in a table in the table footer. The key-value size can be accessed via
db.Tables(..)
call. It returns the list of all tables along with the total size of key-values.This change is