From 55e71b090259eb775c1bb74a2c3ec23bdfba8db5 Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Mon, 5 May 2014 10:27:02 -0600 Subject: Add inline bucket support. This commit adds support for writing small buckets directly inline to their value in their parent's leaf node. Previously, subbuckets would simply have a bucket header stored in their parent bucket which pointed to the root page. This required that every bucket use at least a single page. This has a high overhead for buckets with only one or two small items. Inline buckets checks subbuckets to see if they only have a small amount of data (about 1kb) and no subbuckets. If these conditions are met then the bucket's root node is written to a fake page which is simply a pointer to the end of the bucket's header. Fixes #124. --- tx_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tx_test.go') diff --git a/tx_test.go b/tx_test.go index 61fa5d9..e466765 100644 --- a/tx_test.go +++ b/tx_test.go @@ -219,7 +219,7 @@ func TestTx_DeleteBucket(t *testing.T) { db.Update(func(tx *Tx) error { // Verify that the bucket's page is free. - assert.Equal(t, []pgid{7, 6, root, 2}, db.freelist.all()) + assert.Equal(t, []pgid{5, 4}, db.freelist.all()) // Create the bucket again and make sure there's not a phantom value. b, err := tx.CreateBucket([]byte("widgets")) -- cgit v1.2.3