summaryrefslogtreecommitdiff
path: root/jstests/indexh.js
diff options
context:
space:
mode:
authorAaron <aaron@10gen.com>2010-06-14 15:47:12 -0700
committerAaron <aaron@10gen.com>2010-06-14 15:47:12 -0700
commitd782c98f9cf998eb2bd1dac6850c4c8a54e99fd1 (patch)
tree61694c3e32a31bcabee864f9e730372fbe094843 /jstests/indexh.js
parent1e4a97089ee436fa1c164d2caa07097559a64cef (diff)
downloadmongo-d782c98f9cf998eb2bd1dac6850c4c8a54e99fd1.tar.gz
SERVER-366 btree extent and node freeing
Diffstat (limited to 'jstests/indexh.js')
-rw-r--r--jstests/indexh.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/jstests/indexh.js b/jstests/indexh.js
new file mode 100644
index 00000000000..9801b7d8c84
--- /dev/null
+++ b/jstests/indexh.js
@@ -0,0 +1,24 @@
+skipIfTestingReplication();
+
+t = db.jstests_indexh;
+
+// index extent freeing
+t.drop();
+t.save( {} );
+var s1 = db.stats().dataSize;
+t.ensureIndex( {a:1} );
+var s2 = db.stats().dataSize;
+assert.automsg( "s1 < s2" );
+t.dropIndex( {a:1} );
+assert.eq.automsg( "s1", "db.stats().dataSize" );
+
+// index node freeing
+t.drop();
+t.ensureIndex( {a:1} );
+var big = new Array( 1000 ).toString();
+for( i = 0; i < 1000; ++i ) {
+ t.save( {a:i,b:big} );
+}
+var s3 = db.stats().indexSize;
+t.remove( {} );
+assert.automsg( "db.stats().indexSize < s3" ); \ No newline at end of file