Skip to content
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

feat(info): Show index and bloom filter size #1543

Merged
merged 3 commits into from
Oct 3, 2020
Merged

Conversation

jarifibrahim
Copy link
Contributor

@jarifibrahim jarifibrahim commented Sep 28, 2020

This PR depends upon dgraph-io/ristretto#197
badger info now shows index size and bloom filter size

>badger info --dir xxx --show-tables
SSTable [L3, 204, 0450361] [    00000000046B8156, v1 ->     000000000472608E, v1] [433 kB] [1.0 MB] 
SSTable [L3, 205, 0450360] [    00000000011132C7, v1 ->     00000000011811FE, v1] [433 kB] [1.0 MB] 
SSTable [L3, 206, 0450360] [    00000000028EAB05, v1 ->     0000000002958A3C, v1] [433 kB] [1.0 MB] 
SSTable [L3, 207, 0450361] [    0000000003ACC537, v1 ->     0000000003B3A46F, v1] [433 kB] [1.0 MB] 
SSTable [L3, 208, 0450361] [    0000000005E8F995, v1 ->     0000000005EFD8CD, v1] [433 kB] [1.0 MB] 
SSTable [L3, 209, 0395313] [    000000000472608F, v1 ->     00000000047868BF, v1] [380 kB] [524 kB] 
SSTable [L3, 210, 0395313] [    00000000011811FF, v1 ->     00000000011E1A2F, v1] [380 kB] [524 kB] 


This change is Reviewable

Copy link
Contributor

@martinmr martinmr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 3 of 3 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ashish-goswami and @manishrjain)

Copy link
Contributor

@manishrjain manishrjain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 3 of 3 files at r1, 2 of 2 files at r2.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @ashish-goswami and @jarifibrahim)


badger/cmd/info.go, line 253 at r2 (raw file):

		fmt.Printf("SSTable [L%d, %03d, %07d] [%20X, v%d -> %20X, v%d] [%s] [%s] \n",
			t.Level, t.ID, t.KeyCount, lk, lt, rk, rt, hbytes(int64(t.IndexSz)), hbytes(int64(t.BfSize)))

100 chars.

Also sum it up and print the total index size.


table/table.go, line 659 at r2 (raw file):

// BFSize returns the size of the bloom filter in bytes stored in memory. The
// size of on-disk representation would be less than the in-memory representation.
func (t *Table) BFSize() int {

BloomFilterSize()

@jarifibrahim jarifibrahim merged commit 4b6872e into master Oct 3, 2020
@jarifibrahim jarifibrahim deleted the ibrahim/index-info branch October 3, 2020 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants