It appears that it is still an issue with 1.6. We're running in a
delete heavy environment, so I decided to run a test to see what
happens when repeatedly inserting and deleting from a collection.
simple PHP script:
<?php
$m = new Mongo();
$c = $m->test->foo;
for ($i = 0; $i < 6000000; $i++) {
$c->save(array("data" => "xxxxxxxxxxxxxxxxxxxxxxxx"));
}
?>
So, I run that to dump a bunch of junk data into a collection.
> db.stats();
{
"collections" : 3,
"objects" : 6000004,
"avgObjSize" : 59.99999000000667,
"dataSize" : 360000180,
"storageSize" : 476848640,
"numExtents" : 19,
"indexes" : 1,
"indexSize" : 296511376,
"fileSize" : 1006632960,
"ok" : 1
}
Index size is roughly 300M. Remove all the data:
> db.foo.remove();
> db.stats();
{
... snip ....
"indexSize" : 2318336,
}
2.3 megabytes still hanging around. Not a crazy amount of wasted
space, but if I run the process again:
$ php writer.php
> db.foo.remove();
>
> db.stats();
{
"indexSize" : 4653056,
}
and again...
$ php writer.php
> db.foo.remove();
> db.stats();
{
"indexSize" : 7028736,
}
I'm fairly certain this kind of reclamation issue is pretty common in
the DB world. I still have nightmares about running vacuum in the old
Postgres 7.x days.
On Oct 6, 12:06 am, Chase <
chase.wolfin...@gmail.com> wrote:
> I saw the following thread and it seems like it is a known issue with
> index fragmentation and the need to reindex.
>
>
http://groups.google.com/group/mongodb-user/browse_thread/thread/6a5f...